`

struts,与spring整合

阅读更多

web.xml要配上

<listener-class>
         org.springframework.web.context.ContextLoaderListener
     </listener-class>

 

然后struts.xml配上

<struts>
 <package name="dashuo" extends="struts-default">
  <action name="test" class="shuo">
   <result>/MyJsp.jsp</result>
  </action>
 
 </package>
</struts>
class="shuo"是伪类,指向的是spring的beanID

<bean id="shuo" class="dashuo.action.Tuzi" ></bean>

 

及此,整合完成,action的创建交给了spring

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics