티스토리 뷰

Knowledge

sitemesh(사이트메시) 적용

메디츠 2024. 1. 21. 13:35
반응형

16년 4월 기준.

 

sitemesh.xml

<sitemesh>

<property name="decorators-file" value="/WEB-INF/decorators.xml"/>

<excludes file="${decorators-file}"/>

<page-parsers>

<parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.HTMLPageParser" />

</page-parsers>

<decorator-mappers>

<mapper class="com.opensymphony.module.sitemesh.mapper.PageDecoratorMapper">

<param name="property.1" value="meta.decorator" />

<param name="property.2" value="decorator" />

</mapper>

<mapper class="com.opensymphony.module.sitemesh.mapper.FrameSetDecoratorMapper">

</mapper>

<mapper class="com.opensymphony.module.sitemesh.mapper.AgentDecoratorMapper">

<param name="match.MSIE" value="ie" />

<param name="match.Mozilla [" value="ns" />

<param name="match.Opera" value="opera" />

<param name="match.Lynx" value="lynx" />

</mapper>

<mapper class="com.opensymphony.module.sitemesh.mapper.PrintableDecoratorMapper">

<param name="decorator" value="printable" />

<param name="parameter.name" value="printable" />

<param name="parameter.value" value="true" />

</mapper>

<mapper class="com.opensymphony.module.sitemesh.mapper.RobotDecoratorMapper">

<param name="decorator" value="robot" />

</mapper>

<mapper class="com.opensymphony.module.sitemesh.mapper.ParameterDecoratorMapper">

<param name="decorator.parameter" value="decorator" />

<param name="parameter.name" value="confirm" />

<param name="parameter.value" value="true" />

</mapper>

<mapper class="com.opensymphony.module.sitemesh.mapper.FileDecoratorMapper">

</mapper>

 

<mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">

<param name="config" value="${decorators-file}" />

</mapper>

</decorator-mappers>

</sitemesh>

 

decorators.xml

<?xml version="1.0" encoding="UTF-8"?>

<decorators defaultdir="/view">

<excludes>

<pattern>/resources/*</pattern>

</excludes>

<!--

<decorator name="top" page="/WEB-INF/view/decorators/top.jsp" />

-->

<decorator name="foot" page="/WEB-INF/view/decorators/foot.jsp" />

 

<decorator name="layout" page="/WEB-INF/view/decorators/layout.jsp">

<pattern>/*</pattern>

</decorator>

 

<decorator name="layout2" page="/WEB-INF/view/decorators/layout2.jsp">

<pattern>/login/*</pattern>

<pattern>/product/getList</pattern>

<pattern>/product/getPlanList</pattern>

<pattern>/mypage/*</pattern>

<pattern>/signup/*</pattern>

<pattern>/guide/*</pattern>

</decorator>

 

<decorator name="adminLayout" page="/WEB-INF/view/decorators/adminLayout.jsp">

<pattern>/admin/*</pattern>

</decorator>

<decorator name="mobileLayout" page="/WEB-INF/view/decorators/mobileLayout.jsp">

<pattern>/mobile/*</pattern>

</decorator>

 

<decorator name="emptyLayout" page="/WEB-INF/view/decorators/emptyLayout.jsp" />

</decorators>

 

// decorator 절대경로로 할때는 defaultdir은 의미가 없다.

<decorators defaultdir="/WEB-INF/view">

<decorator name="layout" page="decorators/layout.jsp">

// 상대경로로는 이렇게 사용.

 

<decorator:body />

<page:applyDecorator name="foot" />

반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2025/01   »
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 31
글 보관함