Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is FacesContext an object for entire aplication, or it's instantiated for each jsf page?

 
Vadim Vararu
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is FacesContext an object for entire aplication, or it's instantiated for each jsf page?
 
viswanath yadav
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


FacesContext object is created for entire application, and it handle multiple faces requests.


Thanks

A.Viswanath Yadav
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
viswanath yadav wrote:

FacesContext object is created for entire application, and it handle multiple faces requests.


Thanks

A.Viswanath Yadav


No.

The FacesContext is created and destroyed on every JSF page request. In between page requests, it doesn't exist at all.

One of the more common problems people have with JSF, in fact, is that they attempt to access the FacesContext while handling a non-JSF request such as in a servlet, non-JSF JSP or Struts Action. They fail on a NullPointerException.

JSF is not a "Master Control Program".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic