• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

FacesContext and Servlet

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

In a web-app i am using JSF and also there is servlet .

Will i be able to access FacesContext in Servlet?

 
Saloon Keeper
Posts: 28765
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kumar Gaurav wrote:Hi All,

In a web-app i am using JSF and also there is servlet .

Will i be able to access FacesContext in Servlet?



No. FaceContext is not a durable object. It is constructed by the FacesServlet and discarded once the FacesServlet is done processing. Since 2 servlets can't be running at the same time, you can't access FacesContext in any other servlet.

However, you don't necessarily need the FacesContext. A lot of people think that the FacesContext holds the backing beans. They're wrong. When a backing bean is in session scope, it's just like any other session-scope bean and the J2EE standard attribute access methods can be used to locate it. Likewise for request and application scopes.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic