티스토리 뷰
16년 4월 기준.
// opensymphony 프로젝트
// 2.4.2 기준
web.xml
<!-- Sitemesh Configration -->
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
/WEB-INF/decorators.xml
<?xml version="1.0" encoding="UTF-8"?>
<decorators defaultdir="/decorators">
<decorator name="basic-theme" page="basic-theme.jsp">
<pattern>/data/*</pattern>
</decorator>
</decorators>
basic-theme.jsp
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Café Mirabeau</title>
</head>
<body>
<h1>Header</h1>
<p><b>Navigation</b></p>
<hr />
<decorator:body />
<hr />
<h1>Footer</h1>
</body>
</html>
/data/hour.jsp
// basic-theme.jsp 안에 hour.jsp의 body가 보임
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hours</title>
</head>
<body>
<h1>Weekdays</h1>
<p>5:00pm - 10:00pm</p>
<p>Weekends</p>
<p>5:00pm - 10:00pm</p>
</body>
</html>
'Knowledge' 카테고리의 다른 글
CSON(Cursive Script Object Notation) 관련 (0) | 2024.01.21 |
---|---|
sitemesh(사이트메시) 적용 (0) | 2024.01.21 |
log4j(로그포제이) Config(설정) (0) | 2024.01.21 |
Windows(윈도우) open port(오픈 포트) 확인 (0) | 2024.01.20 |
Tomcat(톰캣) Secure(보안) Configure(설정) 관련 (0) | 2024.01.20 |