webwork与spring,hibernate集成

webwork与spring关联是通过webwork.properties中的webwork.objectFactory = spring实现,指定spring作为ioc容器。此后action就可以在applicationContext.xml文件中如bean一样定义,如下:
<bean id="loginaction" class="com.telling.webwork.action.LoginAction" singleton="false">
<property name="userDao" ref="userDao"></property>
</bean>
而在xwork.xml文件再引用action时,class属性不需写完整的路径名,只需用上面bean的id即可,如下:
<action name="login" class="loginaction">
<result name="success" type="dispatcher">
/main.jsp
</result>

<result name="input" type="dispatcher">
/index.jsp
</result>

<interceptor-ref name="modelParamsStack">
</action>
其他方面的使用互不影响。

你可能感兴趣的:(spring,Hibernate,jsp,bean,Webwork)