|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts.action.Action
jp.terasoluna.fw.web.struts.actions.ActionEx
jp.terasoluna.fw.web.struts.actions.ClearSessionAction
public class ClearSessionAction
Deletes the specified property from the session.
From the list of keys specified in definition file, fetch the key which needs to be deleted from the session and delete it from the session.
Since transition destination is the address specified in "parameter" attribute of <action> element. "parameter" attribute is necessary. The configuration example of Bean definition file and struts-config.xml is shown below.
Configuration example of ClearSessionAction in Bean definition file
<bean name="/clearSessionAction" scope="singleton"
class="jp.terasoluna.fw.web.struts.actions.ClearSessionAction">
<property name="clearSessionKeys">
<list>
<value>userAddress</value>
<value>userPhoneNo</value>
<value>sampleSession</value>
</list>
</property>
</bean>
Configuration example of struts-config.xml
In the above example, when action path name "/clearSessionAction"
is executed, clearSessionKeys property becomes the target key for deletion.
As a result, the session information which is referred with 3 session keys
namely, userAddress, userPhoneNo and sampleSession, is deleted.
<action path="/clearSessionAction"
name="_sampleForm"
scope="session"
parameter="/sessionCleared.do">
</action>
Refer to LogoffAction to cancel the current session.
LogoffAction
Field Summary | |
---|---|
private java.util.List |
clearSessionKeys
List of keys to be deleted from the session. |
private static java.lang.String |
FORWARD_ERRORPAGE_ERROR
Error page (404) Error code indicating the transition failure. |
private static org.apache.commons.logging.Log |
log
Log class. |
Fields inherited from class jp.terasoluna.fw.web.struts.actions.ActionEx |
---|
FORWARD_TXTOKEN_ERROR |
Fields inherited from class org.apache.struts.action.Action |
---|
defaultLocale, servlet |
Constructor Summary | |
---|---|
ClearSessionAction()
|
Method Summary | |
---|---|
org.apache.struts.action.ActionForward |
doExecute(org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Clears the session and forwards to the next screen. |
void |
setClearSessionKeys(java.util.List clearSessionKeys)
Sets the list of keys to be deleted from the session. |
Methods inherited from class jp.terasoluna.fw.web.struts.actions.ActionEx |
---|
addErrors, addMessages, execute, isSaveToken, isTokenCheck, processTokenCheck, setSaveToken, setTokenCheck |
Methods inherited from class org.apache.struts.action.Action |
---|
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static org.apache.commons.logging.Log log
private static final java.lang.String FORWARD_ERRORPAGE_ERROR
private java.util.List clearSessionKeys
Constructor Detail |
---|
public ClearSessionAction()
Method Detail |
---|
public void setClearSessionKeys(java.util.List clearSessionKeys)
clearSessionKeys
- List of keys to be deleted from the session public org.apache.struts.action.ActionForward doExecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
When there is not even a single key to be deleted, returns the information about the transition destination and terminates the process.
doExecute
in class ActionEx
mapping
- Action mappingform
- Action formrequest
- HTTP
Requestresponse
- HTTP
Response
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |