隨筆 - 6  文章 - 129  trackbacks - 0
          <2025年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(467)

          文章檔案(423)

          相冊

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 829819
          • 排名 - 49

          最新評論

          閱讀排行榜

          評論排行榜

          異常信息:
          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. 相應(yīng)的spring bean配置中應(yīng)加入<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 閱讀(1900) 評論(1)  編輯  收藏 所屬分類: springstruts 2

          FeedBack:
          # re: struts2 + spring, 使用session範(fàn)圍的Bean的配置事項 2014-04-23 22:51 lvsl
          非常感謝前輩,問題解決了  回復(fù)  更多評論
            
          主站蜘蛛池模板: 太保市| 营山县| 鹿泉市| 金沙县| 柳州市| 永和县| 建宁县| 孟村| 陈巴尔虎旗| 额尔古纳市| 泾阳县| 宁河县| 平武县| 喜德县| 台中县| 马关县| 特克斯县| 图们市| 古田县| 滁州市| 汾阳市| 芦山县| 临清市| 涿州市| 秦皇岛市| 麟游县| 铜陵市| 阜新| 涟水县| 永登县| 秦皇岛市| 麟游县| 左权县| 缙云县| 轮台县| 孟津县| 公安县| 得荣县| 堆龙德庆县| 阜康市| 山东|