Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing the JSF UIViewRoot from a servlet filter??

 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic