File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Accessing the JSF UIViewRoot from a servlet filter?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Accessing the JSF UIViewRoot from a servlet filter??" Watch "Accessing the JSF UIViewRoot from a servlet filter??" New topic
Author

Accessing the JSF UIViewRoot from a servlet filter??

Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Hello,
I understand it is not possible to set the jsf UIViewroot locale from the servlet filter.
My problem is therefore as follows:
I know which locale the user needs from my servlet filter. How can I communicate to UIviewroot the locale I want from a servlet filter?
Any comment welcome.
Thanks in advance,
J.
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
After some research I came to the conclusion that it is better to use a jsf phase listener instead of a servlet filter to meet my purpose.
J.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

The problem with trying this kind of stuff from a Servlet Filter is that the FacesContext is constructed per-request by the FacesServlet. Since Servlet Filters on the inbound side are intended for doing things before the servlet (or JSP) is invoked, FacesServlet hasn't yet begun to construct the FacesContext.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
Don't get me started about those stupid light bulbs.
 
subject: Accessing the JSF UIViewRoot from a servlet filter??
 
Similar Threads
Dealing in jsf with multiple domains pointing to the same app/war.
Odd problem with RichFaces and Servlet Filter
Best practice for i18n/locale selection?
Http 404, type - status message and resource not found
richfaces and problems with navigation