如何在没有JSP的情况下加载特定页面包括prelude和coda

时间:2012-11-28 16:45:50

标签: jsp include

我已经设置了我的web.xml文件,该文件加载了页脚和标题但我想将我的登录页面分开加载它而没有页眉页脚。有谁知道如何实现这一点。

这是我的Web.xml文件配置。我正在使用Netbeans

 <jsp-config>
    <jsp-property-group>
        <description>JSP configuration for the store front</description>
        <url-pattern>/index.jsp</url-pattern>
        <url-pattern>/WEB-INF/view/*</url-pattern>
        <url-pattern>/WEB-INF/jspf/error/*</url-pattern>
        <include-prelude>/WEB-INF/jspf/header.jspf</include-prelude>
        <include-coda>/WEB-INF/jspf/footer.jspf</include-coda>
    </jsp-property-group>
    <jsp-property-group>
        <description>JSP configuration for the admin console</description>
        <url-pattern>/admin/index.jsp</url-pattern>
        <url-pattern>/admin/login.jsp</url-pattern>
        <url-pattern>/admin/error.jsp</url-pattern>
        <include-prelude>/admin/jspf/header.jspf</include-prelude>
        <include-coda>/admin/jspf/footer.jspf</include-coda>
    </jsp-property-group>
</jsp-config>

1 个答案:

答案 0 :(得分:1)

创建一个没有 include-prelude include-coda 的新组

<jsp-property-group>
    <display-name>Login</display-name>
    <url-pattern>/login/*</url-pattern>
    </jsp-property-group>
</jsp-config>