webwork与spring整合

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的整合完成

 

From:http://www.blogjava.net/apple0668/archive/2007/10/02/150221.html

你可能感兴趣的:(spring,bean,jsp,配置管理,Webwork)