|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts.action.Action
live.struts.actions.CheckedAction
live.struts.actions.SwitchedAction
This is another sort of "convienience base class" that replaces a fairly common process. There are a number of actions the user can take that require both a page to be displayed to get some information then to actually carry out the action. For instance, when creating a network, an action is needed to get the list of guests on the server so the user can select what guests to add, then another action is needed to do the actual addition. As another example, deleting a guest displays a confirmation page before deleting. In order to reduce the proliferation of Actions, things such as these are combined into one Action class which contains a method for each. The sever decides which function to run based on whether the request was GETed or POSTed. In the former case, the Action should simply gather any information necessary and display the page to the user; in the latter, it should actually carry out the request. This class takes care of the determination of which method was used in the request and calling the appropriate method. So an example with delete guest works as follows:
DeleteGuestAction
action (a subclass of this) is called,
act(CheckedAction.ActionInfo)
determines that it was submitted using GET and
calls displayPage(CheckedAction.ActionInfo)
.DeleteGuestAction.displayPage(CheckedAction.ActionInfo)
sets
some attributes indicating what the user is doing and forwards to the
generic confirmation page, which is displayed to the user.performAction(CheckedAction.ActionInfo)
.DeleteGuestAction.displayPage(CheckedAction.ActionInfo)
then
actually deletes the guest.
Nested Class Summary |
Nested classes inherited from class live.struts.actions.CheckedAction |
CheckedAction.ActionInfo |
Field Summary |
Fields inherited from class org.apache.struts.action.Action |
defaultLocale, servlet |
Constructor Summary | |
SwitchedAction()
|
Method Summary | |
org.apache.struts.action.ActionForward |
act(CheckedAction.ActionInfo info)
act is final so that subclasses don't override it by mistake and break things. |
abstract org.apache.struts.action.ActionForward |
displayPage(CheckedAction.ActionInfo info)
This function is called when a request was submitted by an HTTP GET request. |
abstract org.apache.struts.action.ActionForward |
performAction(CheckedAction.ActionInfo info)
This function is called when a request was submitted by an HTTP POST request. |
Methods inherited from class live.struts.actions.CheckedAction |
execute |
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 |
Constructor Detail |
public SwitchedAction()
Method Detail |
public final org.apache.struts.action.ActionForward act(CheckedAction.ActionInfo info)
act
in class CheckedAction
info
- Holds the parameters that were passed to execute,
plus things like the cache and threads info deduced from those
parameters
CheckedAction.act(live.struts.actions.CheckedAction.ActionInfo)
public abstract org.apache.struts.action.ActionForward displayPage(CheckedAction.ActionInfo info)
info
- The request info passed to act(CheckedAction.ActionInfo)
public abstract org.apache.struts.action.ActionForward performAction(CheckedAction.ActionInfo info)
displayPage(CheckedAction.ActionInfo)
so that you know that the user is
coming from that page.
info
- The request info passed to act(CheckedAction.ActionInfo)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |