简体   繁体   English

如何隐藏header.jsp和footer.jsp

[英]How to hide header.jsp and footer.jsp

I had a simple jsp file which can be opened from menu as well as from a link . 我有一个简单的jsp文件,可以从菜单以及链接打开该文件。 When opened from menu it should show header and footer but when opened from a link it should be opened like pop up where the header and footer should not be there . 从菜单中打开时,它应该显示页眉和页脚,但是从链接中打开时,它应该像弹出窗口一样打开,其中页眉和页脚不应存在。 I am able to get the popup and jsp but unable to hide the header and footer when opened as a pop up . 我能够获取弹出窗口和jsp,但在作为弹出窗口打开时无法隐藏页眉和页脚。

<body style="cursor: default;" class="bodyColor" >
    <div id="pageLevel">
        <jsp:include page="../common/header.jsp"></jsp:include>
    </div>
...
<table style="width: 100%">
            <tr>
                <td><%@include file="/jsp/common/footer.jsp"%>
                </td>
            </tr>
</table>

Please help 请帮忙

Just put your content in another JSP content.jsp : 只需将您的内容放在另一个JSP content.jsp中:

JSP with header and footer : 具有页眉和页脚的JSP:

<jsp:include page="header.jsp"></jsp:include>
<jsp:include page="content.jsp"></jsp:include>
<jsp:include page="footer.jsp"></jsp:include>

JSP without header and footer : 没有页眉和页脚的JSP:

<jsp:include page="content.jsp"></jsp:include>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM