2017년 10월 27일 금요일

[jsp]How to include 'header.jsp' and 'footer.jsp' in all the jsp files in easy way using web.xml

It might be wrong... But It is like this way.
Go to WebContent > WEB-INF and source like this.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  <display-name>NeverIn</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>

  <jsp-config>
  <jsp-property-group>
  <url-pattern>/board/*</url-pattern>
  <include-prelude>/board/header.jsp</include-prelude>
  <include-coda></include-coda>
  </jsp-property-group>
  </jsp-config>
</web-app>

댓글 없음:

댓글 쓰기