출처 : Minato님의 노트 (http://minato.springnote.com/pages/4547351)
web.xml
- <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> -
<display-name>SF_003_Struts_Configuration</display-name>
-
<!-- WAS 구동시에 초기 설정값 -->
-
<context-param>
-
<param-name>contextConfigLocation</param-name>
-
<param-value>/WEB-INF/config/spring/applicationContext.xml</param-value>
-
</context-param>
-
<listener>
-
<listener-class>
-
org.springframework.web.context.ContextLoaderListener
-
</listener-class>
-
</listener>
-
<servlet>
-
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param> -
<param-name>config</param-name>
<param-value>/WEB-INF/config/struts/struts-config.xml</param-value> -
</init-param>
-
</servlet>
-
<servlet-mapping>
-
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern> -
</servlet-mapping>
-
<welcome-file-list>
-
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file> -
</welcome-file-list>
- </web-app>
applicationContext.xml
- <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> -
<bean id="boardDao" class="kr.co.bit.lecture.board.dao.ibatis.BoardDaoiBATIS"></bean>
-
<bean id="boardService" class="kr.co.bit.lecture.board.service.spring.BoardServiceSpring">
-
<property name="boardDao" ref="boardDao" />
-
</bean>
-
<bean name="/board/index" class="kr.co.bit.lecture.board.action.IndexAction">
-
<property name="boardService" ref="boardService" />
-
</bean>
- </beans>
struts-config.xml
- <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd"> - <struts-config>
-
<action-mappings>
-
<action path="/board/index" type="org.springframework.web.struts.DelegatingActionProxy">
-
<forward name="index" path="/WEB-INF/views/jsp/board/index.jsp" />
-
</action>
-
</action-mappings>
-
-
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
-
<set-property property="contextConfigLocation" value="/WEB-INF/config/spring/applicationContext.xml" />
-
</plug-in>
- </struts-config>
'Jsp-Servlet > Spring' 카테고리의 다른 글
CommandMapArgumentResolver (3) | 2011.03.21 |
---|---|
BeanNameAware, BeanFactoryAware, ApplicationContextAware (2) | 2011.02.18 |
UrlFilenameViewController 와 같은 기능을 직접 처리 (3) | 2011.01.10 |
url에 해당되는 jsp페이지를 바로 연결 처리 (1) | 2011.01.09 |
spring 2.5 String Utils API (3) | 2011.01.04 |