반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- mybatis
- config
- submit
- centos7
- spring3
- mysql
- git
- post
- PM2
- Eclipse
- Java
- jenkins
- ajax
- nodejs
- Next.js
- jquery
- javascript
- docker
- NextJS
- MariaDB
- security
- rocky9
- spring
- yona
- SpringBoot
- MSsql
- popup
- node.js
- Maven
- console
Archives
- Today
- Total
ふたりで
springboot+sitemesh 설정. 본문
728x90
반응형
SMALL
1. Meven dependency 설정.
<!-- https://mvnrepository.com/artifact/org.sitemesh/sitemesh -->
<dependency>
<groupId>org.sitemesh</groupId>
<artifactId>sitemesh</artifactId>
<version>3.0.1</version>
</dependency>
2. sitemesh java 설정.
package com.graykang.config.sitemesh;
import org.sitemesh.builder.SiteMeshFilterBuilder;
import org.sitemesh.config.ConfigurableSiteMeshFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SiteMeshConfig extends ConfigurableSiteMeshFilter {
@Bean
public FilterRegistrationBean<SiteMeshConfig> siteMeshFilter() {//빈등록
FilterRegistrationBean<SiteMeshConfig> filter = new FilterRegistrationBean<SiteMeshConfig>();
filter.setFilter(new SiteMeshConfig());
return filter;
}
@Override
protected void applyCustomConfiguration(SiteMeshFilterBuilder builder) {
builder
// Map decorators to path patterns.
.addDecoratorPath("/*", "/WEB-INF/decorators/default.jsp")
.addDecoratorPath("**/popup/*", "/WEB-INF/decorators/popup.jsp")
// Exclude path from decoration.
.addExcludedPath("/login")
.addExcludedPath("**/download/*")
.addExcludedPath("**/ajax/*")
.addExcludedPath("**/api/*")
.setMimeTypes("text/html");
}
}
728x90
반응형
SMALL
3. sitemesh용 decorators 폴더 및 참조 파일 생성.
3. sitemesh용 default.jsp 설정.
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/decorators/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<title>기본레이아웃</title>
<%@ include file="/WEB-INF/decorators/include/head_css_js.jsp"%>
<style>
</style>
<script type="text/javascript">
</script>
<sitemesh:write property='head'/>
</head>
<body>
<div id="app">
<div class="wrap">
<div class="side">
</div>
<div class="container container--side">
<sitemesh:write property='body'/>
</div>
<div class="footer clearfix"></div>
</div>
</div>
</body>
</html>
728x90
반응형
LIST
'Spring' 카테고리의 다른 글
spring(springboot) simple POST request (API call) (0) | 2022.03.15 |
---|---|
springboot + security tags를 사용한 menu권한 처리 및 수동 인증(강제로그인). (0) | 2021.12.28 |
JWT 토큰 유효기간 설정. (0) | 2021.10.29 |
springboot starting WARN o.a.t.util.scan.StandardJarScanner - Failed to scan java.io.FileNotFoundException "*.jar" (0) | 2021.10.15 |
VO 모델을 json으로 response시 특정 멤버 변수 숨기기 (0) | 2021.10.08 |
Comments