如果你要使用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