public class SessionUtils extends Object
| Constructor and Description |
|---|
SessionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addToList(javax.servlet.http.HttpSession session,
String attr,
Integer[] ids) |
static void |
addToList(javax.servlet.http.HttpSession session,
String attr,
List ids)
Merge the given ids into the array of pending ids stored under the named session attribute.
|
static void |
addToList(javax.servlet.http.HttpSession session,
String attr,
String[] ids) |
static void |
addToListStr(javax.servlet.http.HttpSession session,
String attr,
List ids)
Merge the given ids into the array of pending ids stored under the named session attribute.
|
static void |
clearWorkflow(javax.servlet.http.HttpSession session,
String workflowName)
Remove any old workflows
|
static int |
countWorkflow(javax.servlet.http.HttpSession session,
String workflowName)
Returns the size of a workflow's stack.
|
static Integer[] |
getList(javax.servlet.http.HttpSession session,
String attr)
Retrieve the array of pending ids stored under the named session attribute.
|
static List |
getListAsList(javax.servlet.http.HttpSession session,
String attr)
Retrieve the
List of pending ids stored under the named session attribute. |
static List<String> |
getListAsListStr(javax.servlet.http.HttpSession session,
String attr)
Retrieve the
List of pending ids stored under the named session attribute. |
static String |
getReturnPath(javax.servlet.http.HttpSession session)
Retrieve the "return path" that locates the point at which a subflow was included into a primary workflow.
|
static Boolean |
getReturnPathIgnoredForOk(javax.servlet.http.HttpSession session)
Retrieve wether the "return path" should be paid attention to for new.
|
static WebUser |
getWebUser(javax.servlet.http.HttpSession session)
Retrieve the cached
WebUser representing the user. |
static void |
moveAttribute(javax.servlet.http.HttpServletRequest request,
String key)
Move the attribute from the session to request scope.
|
static String |
popWorkflow(javax.servlet.http.HttpSession session,
String workflowName)
Takes the current returnPath and pops it off of the workflow's stack.
|
static void |
pushWorkflow(javax.servlet.http.HttpSession session,
org.apache.struts.action.ActionMapping mapping,
String workflowName)
Takes the current returnPath and pushes it onto the workflow's stack.
|
static void |
removeFromList(javax.servlet.http.HttpSession session,
String attr,
Integer[] ids) |
static void |
removeFromList(javax.servlet.http.HttpSession session,
String attr,
List ids)
Remove the given ids from the array of pending ids stored under the named session attribute.
|
static void |
removeFromList(javax.servlet.http.HttpSession session,
String attr,
String[] ids) |
static void |
removeFromListStr(javax.servlet.http.HttpSession session,
String attr,
List ids)
Remove the given ids from the array of pending ids stored under the named session attribute.
|
static void |
removeList(javax.servlet.http.HttpSession session,
String attr)
Remove the array of pending ids stored under the named session attribute.
|
static void |
resetReturnPath(javax.servlet.http.HttpSession session)
clear out the return path stack.
|
static void |
setConfirmation(javax.servlet.http.HttpSession session,
String key)
Set a confirmation message upon completion of a user action.
|
static void |
setConfirmation(javax.servlet.http.HttpSession session,
String key,
Object value0)
Set a confirmation message with a replacement value upon completion of a user action.
|
static void |
setError(javax.servlet.http.HttpSession session,
String key)
Set an error message when a user action fails with a user-level error.
|
static void |
setError(javax.servlet.http.HttpSession session,
String key,
Object value0)
Set an error message with a replacement value when a user action fails with a user-level error.
|
static void |
setError(javax.servlet.http.HttpSession session,
String key,
Object value0,
String property)
Set an error message with a replacement value when a user action fails with a user-level error.
|
static void |
setError(javax.servlet.http.HttpSession session,
String key,
String property)
Set an error message when a user action fails with a user-level error.
|
static void |
setReturnPath(javax.servlet.http.HttpSession session,
String path)
Set the "returnPath", the possible point of origin for a workflow.
|
static void |
setReturnPath(javax.servlet.http.HttpSession session,
String path,
Boolean ignore)
Set the "returnPath," the possible point of origin for a worklow
|
static void |
setWebUser(javax.servlet.http.HttpSession session,
WebUser user) |
static void |
unsetConfirmation(javax.servlet.http.HttpSession session,
String key) |
static void |
unsetError(javax.servlet.http.HttpSession session) |
static void |
unsetReturnPath(javax.servlet.http.HttpSession session)
Unset the "return path" that locates the point at which a subflow was included into a primary workflow.
|
static void |
unsetReturnPathIgnoredForOk(javax.servlet.http.HttpSession session)
Unset the "return path" that locates the point at which a subflow was included into a primary workflow.
|
public static WebUser getWebUser(javax.servlet.http.HttpSession session)
WebUser representing the user.session - the http sessionpublic static void setWebUser(javax.servlet.http.HttpSession session,
WebUser user)
public static Integer[] getList(javax.servlet.http.HttpSession session, String attr)
session - the http sessionattr - the name of the session attributepublic static List getListAsList(javax.servlet.http.HttpSession session, String attr)
List of pending ids stored under the named session attribute.session - the http sessionattr - the name of the session attributepublic static List<String> getListAsListStr(javax.servlet.http.HttpSession session, String attr)
List of pending ids stored under the named session attribute.session - the http sessionattr - the name of the session attributepublic static void addToList(javax.servlet.http.HttpSession session,
String attr,
List ids)
session - the http sessionattr - the name of the session attributeids - the ids to be addedpublic static void addToList(javax.servlet.http.HttpSession session,
String attr,
Integer[] ids)
public static void addToListStr(javax.servlet.http.HttpSession session,
String attr,
List ids)
session - the http sessionattr - the name of the session attributeids - the ids to be addedpublic static void addToList(javax.servlet.http.HttpSession session,
String attr,
String[] ids)
public static void removeFromList(javax.servlet.http.HttpSession session,
String attr,
List ids)
session - the http sessionattr - the name of the session attributeids - the ids to be removedpublic static void removeFromList(javax.servlet.http.HttpSession session,
String attr,
Integer[] ids)
public static void removeFromListStr(javax.servlet.http.HttpSession session,
String attr,
List ids)
session - the http sessionattr - the name of the session attributeids - the ids to be removedpublic static void removeFromList(javax.servlet.http.HttpSession session,
String attr,
String[] ids)
public static void removeList(javax.servlet.http.HttpSession session,
String attr)
session - the http sessionattr - the name of the session attributepublic static String getReturnPath(javax.servlet.http.HttpSession session)
session - the http sessionpublic static void setReturnPath(javax.servlet.http.HttpSession session,
String path)
session - the http sessionpath - the return pathpublic static void setReturnPath(javax.servlet.http.HttpSession session,
String path,
Boolean ignore)
session - The http session.path - The return path url represented as a String.ignore - public static void resetReturnPath(javax.servlet.http.HttpSession session)
public static void unsetReturnPath(javax.servlet.http.HttpSession session)
session - the http sessionpublic static Boolean getReturnPathIgnoredForOk(javax.servlet.http.HttpSession session)
session - the http sessionpublic static void unsetReturnPathIgnoredForOk(javax.servlet.http.HttpSession session)
session - the http sessionpublic static void clearWorkflow(javax.servlet.http.HttpSession session,
String workflowName)
session - workflowName - public static void pushWorkflow(javax.servlet.http.HttpSession session,
org.apache.struts.action.ActionMapping mapping,
String workflowName)
session - The HttpSesion to get and save the workflow to/frommapping - Use the input attribute from this mapping if a returnPath is not defined in the current
session.workflowName - The name of the workflow scope to save the input under.public static String popWorkflow(javax.servlet.http.HttpSession session, String workflowName)
session - The HttpSesion to get and save the workflow to/fromworkflowName - The name of the workflow scope to save the input under.public static int countWorkflow(javax.servlet.http.HttpSession session,
String workflowName)
session - The HttpSesion to get and save the workflow to/fromworkflowName - The name of the workflow scope to save the input under.public static void setConfirmation(javax.servlet.http.HttpSession session,
String key)
session - The servlet session objectkey - the message resource keypublic static void setConfirmation(javax.servlet.http.HttpSession session,
String key,
Object value0)
session - The servlet session objectkey - the message resource keyvalue0 - the replacement valuepublic static void unsetConfirmation(javax.servlet.http.HttpSession session,
String key)
public static void setError(javax.servlet.http.HttpSession session,
String key)
session - The servlet session objectkey - the message resource keypublic static void setError(javax.servlet.http.HttpSession session,
String key,
String property)
session - The servlet session objectkey - the message resource keyproperty - the form property for which the error occurredpublic static void setError(javax.servlet.http.HttpSession session,
String key,
Object value0)
session - The servlet session objectkey - the message resource keyvalue0 - the replacement valuepublic static void setError(javax.servlet.http.HttpSession session,
String key,
Object value0,
String property)
session - The servlet session objectkey - the message resource keyvalue0 - the replacement valueproperty - the form property for which the error occurredpublic static void unsetError(javax.servlet.http.HttpSession session)
public static void moveAttribute(javax.servlet.http.HttpServletRequest request,
String key)
request - The request to move the attribute to.key - Key indicating the attribute to move scope.Copyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.