struts1与spring集成时,需要引入一注入属性 如:
public class UserAction extends Action{
private UserDao userDao;
public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) {
........
}
//getter setter
}
Action不是线程安全的,不知spring是怎样保证线程安全的,是不是phototype bean系统每次都创建实例?同一对象也每次都创建新对象吗?对spring内部不熟悉.
请哪位大侠能帮我指点一下,非常非常地感谢您!
public class UserAction extends Action{
private UserDao userDao;
public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) {
........
}
//getter setter
}
Action不是线程安全的,不知spring是怎样保证线程安全的,是不是phototype bean系统每次都创建实例?同一对象也每次都创建新对象吗?对spring内部不熟悉.
请哪位大侠能帮我指点一下,非常非常地感谢您!
解决方案 »
- 使java写入txt内容分段
- PropertyPlaceholderConfigurer有没有办法把属性注入到类里?
- 求嵌入式学习资料~~
- Servlet.service() for servlet action threw exception
- 常在网页代码中看到<%@ %>请问在@里面可以包含些什么内容呢
- J2EE的源码有没有开放? 哪有下载?
- jprofiler能安装在无界面的linux服务器上吗?
- Tomcat不能自动更新jsp了。求助!
- 没办法 只能来请大侠们看看了 struts formBean问题
- 定时方法后可以加个切面么
- 各位大大,servicemix读写mysql的问题
- 高分紧急求助:做一个游戏类网站需要注意哪些方面??
<action
attribute="userForm"
input="/form/user.jsp"
name="userForm"
path="/user"
parameter="operate"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy" />
type不用本类地址用srping的org.springframework.web.struts.DelegatingActionProxy
<bean name="/user" class="com.accp.web.action.UserAction">
<property name="goodsbiz" ref="goodsbizimp"></property>
<property name="userbiz" ref="userbizimp"></property>
</bean>
spring的name和action的一样这样就OK啦
<action
attribute="userForm"
input="/form/user.jsp"
name="userForm"
path="/user"
parameter="operate"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy" />
type不用本类地址用srping的org.springframework.web.struts.DelegatingActionProxy
<bean name="/user" class="com.accp.web.action.UserAction">
<property name="goodsbiz" ref="goodsbizimp"></property>
<property name="userbiz" ref="userbizimp"></property>
</bean>
spring的name和action的一样这样就OK啦