where i store session variable in jsf as we do in JSP using request.getAttribute() and request.setAt
posted 5 years ago
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
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.
An IDE is no substitute for an Intelligent Developer.