달력

42024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

'Programing/UI Template FrameWork'에 해당되는 글 1건

  1. 2016.10.04 sitemesh3 설정.

web.xml 설정

경로 : \프로젝트이름\src\main\webapp\WEB-INF\web.xml

<filter>
     <filter-name>sitemesh</filter-name>
     <filter-class>org.sitemesh.config.ConfigurableSiteMeshFilter</filter-class>
   </filter>

   <filter-mapping>
     <filter-name>sitemesh</filter-name>
     <url-pattern>/*</url-pattern>
   </filter-mapping>

</filter>

 

sitemesh3.xml 설정

경로 : \프로젝트이름\src\main\webapp\WEB-INF\sitemesh3.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<sitemesh>
  <mapping path="/JSP/KPI/*" decorator="/WEB-INF/jsp/common/decorator/layout.jsp"/>
  <mapping path="/SAMPLE/*" decorator="/WEB-INF/jsp/common/decorator/layout.jsp"/>
  <mapping path="/SERVICE/*" decorator="/WEB-INF/jsp/common/decorator/layout.jsp"/>
  <mapping path="/popup/*" decorator="/WEB-INF/jsp/common/decorator/layout2.jsp"/>

  <mapping path="*/index.jsp" exclude="true"/>    <!-- sitemesh 예외 url  -->

  <mapping path="*/index.do" exclude="true"/>     <!-- sitemesh 예외 url  -->

  <mapping path="*/login_form.html" exclude="true"/>   <!-- sitemesh 예외 url  -->

</sitemesh>

 

pom.xml  설정

경로 : \프로젝트이름\pom.xml

<dependencies>

 <dependency>
   <groupId>org.sitemesh</groupId>
   <artifactId>sitemesh</artifactId>
   <version>3.0.1</version>
  </dependency>

</dependencies>

 

layout.jsp 설정

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE>
<html>
  <head>
   <title>타이틀<sitemesh:write property='title'/></title>
 <meta charset="UTF-8">
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
 <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">

 <script type="text/javascript" src="/resource/js/jquery-1.12.4.js"></script>
 <script type="text/javascript" src="/resource/js/jquery-ui-1.10.0.js"></script>
 <script type="text/javascript" src="/resource/js/jquery-blockUI.js"/></script>
 <script type="text/javascript" src="/resource/js/jquery.qtip.min.js"/></script>

 <link rel="stylesheet" type="text/css" href="/resource/css/ui_library.css" />
 <link rel="stylesheet" type="text/css" href="/resource/css/ui_library_new.css" />
 <link rel="stylesheet" type="text/css" href="/resource/css/ui_library_ie7.css" />
 <link rel="stylesheet" type="text/css" href="/resource/css/ui_jquery.css" />
     <sitemesh:write property='head'/>
  </head>
  <body>
  <jsp:include page="/decorator/header.do"></jsp:include>
  <jsp:include page="/decorator/left.do"></jsp:include>
     <div class='mainBody'>
      <sitemesh:write property='body'/>
        </div>
    </div>

    <!-- //contents -->
  </div>
 <div>
  <!-- footer-->
 <%@include file="footer.jsp"%>
 <sitemesh:write property='footer'/>
 <!-- //footer-->
 </div>
  </body>
</html>

Posted by 한설림
|