개발/Spring

Eclipse에서 SPRING_Spring MVC 파일 설정

Zziny 2021. 10. 13. 19:44

 Spring Legacy Project 사용하기 위해 Eclipse Enterprise Java and Web Developer Tools 3.23 설치

Spring Legacy Project 생성 > Template은 Spring MVC Project

base package depth는 (항상) 3depth로 설정

Project Properties > Jaca Build Path > Libraries > JRE System Library [JavaSE-1.8]로 설정

기존 JRE System Library Remove하고 Add External Class Folder

(현재 C:/Program Files/openjdk-1.8 사용중)

Java Compiler 버전 맞춰주기

Project Facets -> Dynamic Web Module, Java 버전 맞춰주기

src/main/java -> java 파일

src/main/resources -> 설정파일

web.xml 파일 version 수정

pom.xml 파일 version 수정 (사용하는 버전에 맞춰서)

java-version -> 1.8

maven-compiler-plugin -> source, target을 1.8

springframework-version -> 5.3.10

aspectj-version -> 1.9.7

maven repository에서 servlet, jsp 최신버전으로

 

루트 컨텍스트(Root Context) : src/main/webapp/spring/root-context.xml

서브릿 컨텍스트(Servlet Context) : src/main/webapp/spring/appServlet/servlet-context.xml

src/main/resources/log4.xml

[[log4j level]]

TRACE : 추적
DEBUG : 디버깅
INFO : 정보
WARN : 경고
ERROR : 에러
FATAL : 치명적

<param name="ConversionPattern" value="%-5p: %c - %m%n" />

https://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout

 

Log4j – Log4j 2 Layouts

facility String The facility is used to try to classify the message. The facility option must be set to one of "KERN", "USER", "MAIL", "DAEMON", "AUTH", "SYSLOG", "LPR", "NEWS", "UUCP", "CRON", "AUTHPRIV", "FTP", "NTP", "AUDIT", "ALERT", "CLOCK", "LOCAL0",

logging.apache.org