728x90
app-tiles-definition.xml 에
<!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="base" template="/WEB-INF/jsp/layout/app_main_layout.jsp">
<put-attribute name="css" value="/WEB-INF/jsp/layout/tiles/import/app_css.jsp" />
<put-attribute name="script" value="/WEB-INF/jsp/layout/tiles/import/app_script.jsp" />
<put-attribute name="header" value="/WEB-INF/jsp/layout/tiles/app_header.jsp" />
<put-attribute name="left" value="/WEB-INF/jsp/layout/tiles/app_sidenav.jsp" />
<put-attribute name="subcon" value="/WEB-INF/jsp/layout/tiles/app_subcontents.jsp" />
<put-attribute name="footer" value="/WEB-INF/jsp/layout/tiles/app_footer.jsp" />
<put-attribute name="banner" value="/WEB-INF/jsp/layout/tiles/app_banner.jsp" />
<put-attribute name="allmenu" value="/WEB-INF/jsp/layout/tiles/app_allmenu.jsp" />
<put-attribute name="quickmenu" value="/WEB-INF/jsp/layout/tiles/app_quickmenu.jsp" />
</definition>
<!-- 메뉴 미표시 -->
<definition name="baseEmpty" template="/WEB-INF/jsp/layout/tiles/templateEmpty.jsp">
<put-attribute name="css" value="/WEB-INF/jsp/layout/tiles/import/app_css.jsp" />
<put-attribute name="script" value="/WEB-INF/jsp/layout/tiles/import/app_script.jsp" />
</definition>
<definition name="*.part" extends="baseEmpty">
<put-attribute name="body" value="/WEB-INF/jsp/app/{1}.jsp" />
</definition>
<definition name="*/*.part" extends="baseEmpty">
<put-attribute name="body" value="/WEB-INF/jsp/app/{1}/{2}.jsp" />
</definition>
<definition name="*/*/*.part" extends="baseEmpty">
<put-attribute name="body" value="/WEB-INF/jsp/app/{1}/{2}/{3}.jsp" />
</definition>
<!-- 메뉴 표시 -->
<definition name="*/*/*/*" extends="base">
<put-attribute name="main" value="/WEB-INF/jsp/app/{1}/{2}/{3}/{4}.jsp" />
</definition>
<definition name="*/*/*" extends="base">
<put-attribute name="main" value="/WEB-INF/jsp/app/{1}/{2}/{3}.jsp" />
</definition>
</tiles-definitions>
메뉴표시 / 메뉴 미표시로 분리하고
templateEmpty.jsp 를 해당 경로에 생성
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scal=1, user-scalable=no"/>
<title>빈화면</title>
<tiles:insertAttribute name="css" />
<tiles:insertAttribute name="script" />
</head>
<body>
<tiles:insertAttribute name="body" />
</body>
</html>
그리고나서 팝업으로 띄울 화면을 호출 할 때,
@RequestMapping(value = "HomePopup.do")
return에 "~Popup.part"; .part를 붙여준다.
그러면 HomePopup.do 를 호출 하였을 시, jsp 경로를 호출하면서, .part가 적용되어
Tiles가 적용되지 않은 화면이 호출된다.
728x90
'Dev's > Web' 카테고리의 다른 글
[Dev's] 중복 팝업 방지 - 새창/새탭 생성 시, "Scripts may close only the windows that were opened by them." 해결 (1) | 2022.09.30 |
---|---|
[Dev's] VideoJs 영상 플레이어 Reset하기 (0) | 2022.05.10 |
[Dev's] 스프링 스케쥴러 설정 시, 변수값 넣어서 동적생성하기 (0) | 2022.01.06 |
[Dev's] Spring CustomViewResolver 사용하기 (0) | 2021.12.06 |
[Dev's] 영상에 vtt 자막 동적으로 생성, 제어하기 (0) | 2021.11.15 |