jsp からセッション スコープの sping Bean にアクセスする方法を学びましたが、次のエラーが発生しました。
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? scoped beans from jsp
request.getSession().getAttribute("scopedTarget.otmSessionHolder")).getUserVO()
私のweb.xml:
<listener>
<description>Spring Context Listener</description>
<display-name>Spring Context Listener</display-name>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<display-name>Request Context Listener</display-name>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<servlet>
<description>This Servlet intercepts all requests for this WebApplication</description>
<servlet-name>SpringDispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/beans/web/**/*-Beans.xml</param-value>
</init-param>
<servlet>
<description>This Servlet intercepts all requests for this WebApplication</description>
<servlet-name>SpringDispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/beans/web/**/*-Beans.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<description>This Servlet intercepts all RESTful requests for this Web Application</description>
<servlet-name>RESTfulSpringDispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/beans/web/RESTful-Beans.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
しかし、それでも私はこの例外を受け取ります。私はテンプレートにsitemeshデコレータを使用しています.これらのフォーラムを通過していますが、役に立ちません.