org.springframework.beans.factory.BeanCreationException: Scope 'request' is not active for the current thread

来源:互联网 发布:网络服务器配置与应用 编辑:程序博客网 时间:2024/06/06 17:42

如果你要使用request or session scope bean,那么在web.xml里需要加上下面这段设置:

 <listener>
      <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
 </listener>

 否则就会出现org.springframework.beans.factory.BeanCreationException: Scope 'request' is not active for the current thread

原创粉丝点击