This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

where i store session variable in jsf as we do in JSP using request.getAttribute() and request.setAt  RSS feed

 
Yahya Arshad
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know we declare a managed bean scope in Web.xml file but i want that if a managed bean is in request scope in web.xml see
what i want..
once i user fillup form there he enter his name.. now want to store that name in a a scope that later i can access it.. as request.getAttribute() and request.setAttribute() but how i can do this in JSF please help me tahnks in advance
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, you do not define session objects in web.xml. You define them in faces-config.xml. Or, in JSF2, by defining beans with JSF attributes.

Request-scope objects have a very short lifespan and they're not very useful in JSF, because JSF postbacks use a separate request for each postback. However, all of the JSF version 1 scopes exactly correspond to standard J2EE scopes, so a JSF session-scope managed bean can be access by a servlet by simply having the servlet use the session getAttribute() method.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!