webwork和spring的整合:
1、webwork.properties文件中加入webwork.objectFactory = spring
2、配置web.xml
<filter>
<filter-name>webwork</filter-name>
<filter-class>
com.opensymphony.webwork.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>webwork</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
3、xwork.xml文件配置
由于webwork的action交給spring的IoC來管理,xwork.xml配置簡化:
<action name="login" class="
userAction">
<result name="success">/login_success.jsp</result>
<result name="error">/login.jsp</result>
4、spring的applicationContext.xml配置
<bean id="
userAction" class="
org.apple.action.UserAction">
<property name="userService">
<ref bean="userService"/>
</property>
</bean>
經過幾步的配置,webwork和spring的整合完成。
-------------------------------------------------------------------------------------------------
PS:本博客文章,如果沒有注明是有“轉”字樣,屬于本人原創。如果需要轉載,務必注明作者和文章的詳細出處地址,否則不允許轉載,多謝合作!
posted on 2007-10-02 23:50
apple0668 閱讀(1406)
評論(2) 編輯 收藏 所屬分類:
spring 、
webwork