| Author |
how to access faces context and backing beans in a servlet filter
|
Vincent Zhao
Greenhorn
Joined: Jul 09, 2008
Posts: 28
|
|
Is there a way to get hold of a managed bean with session scope in a servlet filter? The code below throws an error due to the fact that the faces context is null.
|
 |
Vincent Zhao
Greenhorn
Joined: Jul 09, 2008
Posts: 28
|
|
This thread help me out:
http://wiki.apache.org/myfaces/AccessFacesContextFromServlet AccessFacesContextFromServlet
|
 |
Vincent Zhao
Greenhorn
Joined: Jul 09, 2008
Posts: 28
|
|
This post help me a lot.
webpage
|
 |
Vincent Zhao
Greenhorn
Joined: Jul 09, 2008
Posts: 28
|
|
|
Now, I can access backing beans in a servlet filter. But after I populate value to this backing bean, it didn't keep in session scope for future. How can I do next?
|
 |
Vincent Zhao
Greenhorn
Joined: Jul 09, 2008
Posts: 28
|
|
Yes, there is a way to get hold of a managed bean with session scope in a servlet filter.
See here:
AccessFacesContextFromServlet
and here:
how to access faces context and backing beans in a servlet filter
After I get User bean in my Servlet filter, I populate value to this bean, for example:
user.setLanguage(request.getParameter("locale"));
The User bean is in session scope. The User bean's language attribute suppose to be same in the whole session scope, but later on, I got null. My question is:
how to keep this value in session scope?
|
 |
 |
|
|
subject: how to access faces context and backing beans in a servlet filter
|
|
|