ADF Provided different scope to handle data :
1. Request Scope
2. Session Scope
3. Application Scope
4. PageFlow Scope
5. BackingBean Scope
6. View Scope
Session Scope to store values through out the session
Note : Try to avoid Session Scope in Application as much as possible
FacesContext context =
FacesContext.getCurrentInstance();
HttpSession session = (HttpSession)
context.getExternalContext().getSession(false);
session.setAttribute(Attribute, value);
session.getAttribute(Attribute);Example :
session.setAttribute("UserName", "Krishna");
session.getAttribute("UserName");Happy coding :-)
No comments:
Post a Comment