-
[SPRING] SPRING 게시판 (1) - 프로젝트 생성JAVA/SPRING 2020. 3. 10. 20:25728x90
프로젝트 생성
Spring Legacy Project -> Spring MVC Project
톰캣 설정
Character Encoding 설정
<!-- webapp/WEB-INF/web.xml --> <!-- Character Set Filter --> <filter> <filter-name>encodingFilter</filter-name> <filter-class> org.springframework.web.filter.CharacterEncodingFilter </filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
스프링 환경 설정
servlet-context.xml를 [src/main/resources/]에 root-context.xml는 [src/main/resources/]에 spring이라는 폴더를 만들어 관리
<!-- webapp/WEB-INF/web.xml --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/*-context.xml</param-value> <!-- 변경 --> </context-param> <!-- Creates the Spring Container shared by all Servlets and Filters --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- Processes application requests --> <servlet> <servlet-name>appServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:servlet-context.xml</param-value> <!-- 변경 --> </init-param> <load-on-startup>1</load-on-startup> </servlet>
728x90'JAVA > SPRING' 카테고리의 다른 글
[SPRING] Resource specification not allowed here for source level below 1.7 Error (0) 2020.03.11 [SPRING] SPRING게시판 (2) - DB 연동 (0) 2020.03.10 [Spring Boot] Encoding 설정 (0) 2020.02.13 [Spring] Don't know how to iterate over supplied "items" (0) 2020.02.02 [Spring] JpaRepository Method (0) 2020.01.28