728x90
/WEB-INF/아래 dispatcher-servlet.xml 을
=>
/WEB-INF/아래 spring 폴더 만들어서
security-context.xml
service-context.xml
servlet-context.xml
로 나눔
- web..xml에서 환경설정
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1"
metadata-complete="true">
<!-- 톰켓,세션이 끝날때 시작할때 이벤트 처리 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/service-context.xml
/WEB-INF/spring/security-context.xml
</param-value>
</context-param>
<!-- DispatcherServlet copy qualified name 해서 붙여놓고 .class지우기 -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup> <!-- 우선순위 가장 먼저 -->
<async-supported>true</async-supported> <!-- 서블릿 비동기적 로드 -->
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern> <!-- / -> /*를 사용하면 모두 dispatcher-servlet.xml을 거쳐야한다. -->
</servlet-mapping>
728x90
'SPRING' 카테고리의 다른 글
[Spring] Annotation 어노테이션 - @Component (0) | 2022.05.11 |
---|---|
[Spring] Annotation 어노테이션 설정 (0) | 2022.05.11 |
[Spring] 오라클(Oracle) 연동 (Eclipse) (0) | 2022.05.11 |
[Spring] tiles ViewResolver 설정하기 (0) | 2022.05.11 |
[Spring] tiles 지시서 작성하기2 (와일드카드이용) (0) | 2022.05.11 |