Results 1 to 1 of 1
- 09-28-2007, 12:45 PM #1
How to select Initial Web Configuration to effect the scoping of beans at the request
Some initial configuration is needed before you can set about defining your bean definitions. This extra setup is not required if you just want scopes singleton and prototype.
In case you are using Servlet 2.4+ web container, then add the following ContextListener to the XML declarations in your web applications 'web.xml' file.
These snippets bind the HTTP request object to the Thread that is servicing that request. This makes beans that are request- and session-scoped available further in applications.Java Code:<web-app> <listener> <listener-class>org.springframework.web.context.scope.RequestContextListener</listener- class> </listener> </web-app> In case of older web container (before Servlet 2.4), use a (provided) javax.servlet.Filter implementation in web.xml File. <web-app> <filter> <filter-name>requestContextFilter</filter-name> <filter-class>org.springframework.web.filter.RequestContextFilter</filter-class> </filter> <filter-mapping> <filter-name>requestContextFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
Similar Threads
-
Initial capacity of ArrayList
By bugger in forum New To JavaReplies: 12Last Post: 12-30-2009, 08:16 AM -
How to select Initial Web Configuration to effect the scoping of beans at the request
By Java Tip in forum Java TipReplies: 0Last Post: 03-31-2008, 10:06 AM -
How to make Beans Lazily-instantiating beans
By Java Tip in forum Java TipReplies: 0Last Post: 03-30-2008, 10:10 AM -
How to make Beans Lazily-instantiating beans
By JavaBean in forum Java TipReplies: 0Last Post: 09-26-2007, 08:41 PM -
shadow effect in swt-sash
By Jack in forum SWT / JFaceReplies: 2Last Post: 07-02-2007, 05:04 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks