異常信息:
Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
解決方法:
1. 在web.xml文件中添加listener
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
2. 相應的spring bean配置中應加入
<aop:scoped-proxy/>此行代碼
<bean id="userAction" class="org.gecs.mes.common.action.UserAction" autowire="byName" scope="session">
<aop:scoped-proxy/>
</bean>
posted on 2011-09-06 10:22
Ke 阅读(1877)
评论(1) 编辑 收藏 所属分类:
spring 、
struts 2