Programming > Spring Framework

Spring Boot web : 운영배포 디렉토리

Spring boot 로 web 서비스를 만들고 내장형 WAS(tomcat etc...)로 구동할 경우, 배포 디렉토리 구조

eclipse 구조

리소스 파일일 읽어들이는 디렉토리 (물리적 구조를 아래와 같이 만들고 그아래 리소스를 넣는다)

├─src
│  ├─main
│  │  ├─resources
│  │  │  ├─static
│  │  │  ├─resources
│  │  │  ├─public

JSP 파일의 위치

├─src
│  ├─main
│  │  ├─webapp
│  │  │  ├─WEB-INF
 |   │  │  │  ├─views or jsp etc (properties 내 spring.mvc.view.prefix 값)

 

운영환경 - 라이브러리/클래스 배포시

※ 배포는 클래스패스를 기준으로 배포한다. 

① JSP 파일 배포는 META-INF/resources/WEB-INF 아래에 위치해야 한다.
② 리소스 파일은 클래스패스 바로 아래에 미리 정의된 폴더명( static, resources, public) 아래에 넣는다.
     리소스 파일들을 META-INF/resources 아래에 바로 넣어되 된다.

web_root
│  application.properties
│  logback.xml
├─com
│  ├─cyber
│  │  └─web
│  └─entry
│          MainApplication.class
├─mapper
│  └─admin
│          AdminMapper.xml

├─META-INF
│  └─resources
│      └─WEB-INF
│          └─views
│                  error.jsp
│                  index.jsp


├─mybatis
│      mybatis-config.xml

└─static
    │  emc.download.zip
    └─css
            style.css
※ 리소스의경우

├─META-INF
│  └─resources

 |       ├─css      ※ 여기에 같이 넣어도 됨
│      └─WEB-INF
│          └─views
│                  error.jsp
│                  index.jsp