tiles
์์ฑ์ผ: 2021๋ 2์ 16์ผ ์คํ 2:46
pom.xml
<!-- ํ์ผ์ฆ์ ์ฉ -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-extras</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-servlet</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>3.0.5</version>
</dependency>
์๋ธ๋ฆฟ ์ปจํ ์คํธ
<!-- Tiles ๋ทฐ ๋ฆฌ์กธ๋ฒ -->
<beans:bean id="tielsViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<beans:property name="viewClass" value="org.springframework.web.servlet.view.tiles3.TilesView" />
<beans:property name="order" value="1" />
</beans:bean>
<!-- Tiles ์ค์ ํ์ผ -->
<beans:bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
<beans:property name="definitions">
<beans:list>
<beans:value>/WEB-INF/tiles/tiles.xml</beans:value>
</beans:list>
</beans:property>
</beans:bean>
tiles.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
"http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
<tiles-definitions>
<!-- ๊ธฐ๋ณธ ๋ ์ด์์ -->
<definition name="layout" template="/WEB-INF/tiles/components/layout.jsp">
<put-attribute name="header" value="/WEB-INF/tiles/components/header.jsp" />
<put-attribute name="content" value="" />
<put-attribute name="footer" value="/WEB-INF/tiles/components/footer.jsp" />
</definition>
<definition name="layout/*/*" extends="layout">
<put-attribute name="content" value="/WEB-INF/jsp/{1}/{2}.jsp" />
</definition>
<!-- ๋ ์ด์์ ์์ -->
<definition name="notLayout" template="/WEB-INF/tiles/components/layout.jsp">
<put-attribute name="header" value="" />
<put-attribute name="content" value="" />
<put-attribute name="footer" value="" />
</definition>
<definition name="notLayout/*/*" extends="notLayout">
<put-attribute name="content" value="/WEB-INF/jsp/{1}/{2}.jsp" />
</definition>
<!-- ๋ฆฌ๋ฉ์ค์ฟจ ๋ ์ด์์ -->
<definition name="schoollayout" template="/WEB-INF/tiles/components/schoollayout.jsp">
<put-attribute name="header" value="" />
<put-attribute name="content" value="" />
<put-attribute name="footer" value="" />
</definition>
<definition name="schoollayout/*/*" extends="schoollayout">
<put-attribute name="content" value="/WEB-INF/jsp/{1}/{2}.jsp" />
</definition>
<!-- ๋ฉค๋ฒ ๋ ์ด์์ -->
<definition name="memberLayout" template="/WEB-INF/tiles/components/layout.jsp">
<put-attribute name="header" value="/WEB-INF/tiles/components/header_member.jsp" />
<put-attribute name="content" value="" />
<put-attribute name="footer" value="/WEB-INF/tiles/components/footer_member.jsp" />
</definition>
<definition name="memberLayout/*/*" extends="memberLayout">
<put-attribute name="content" value="/WEB-INF/jsp/{1}/{2}.jsp" />
</definition>
</tiles-definitions>
์ด๋ฐ์์ผ๋ก ๋ ์ด์์ ๋ง๋ค์ด์ฃผ๋ฉด๋จ
Last updated