KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > view > jsp > actionflow > UseActionTag


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.view.jsp.actionflow;
8
9
10 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
11
12 import com.inversoft.verge.mvc.controller.actionflow.ActionFlowAction;
13 import com.inversoft.verge.mvc.controller.actionflow.ActionFlowConstants;
14
15
16 /**
17  * <p>
18  * This class also the page access to the Action that was
19  * generated by the second to last node of the ActionFlow.
20  * This is useful for retrieving the last action executed
21  * or the exception that caused alink to be followed.
22  * </p>
23  *
24  * @author Brian Pontarelli
25  */

26 public class UseActionTag extends TagSupport JavaDoc {
27
28     private String JavaDoc var;
29
30
31     /**
32      * Gets the name of the page variable that the ActionFlowAction will be stored
33      * under in the pageContext and also published via the TEI class.
34      *
35      * @return The name of the page variable of the repository item
36      */

37     public String JavaDoc getVar() {
38         return var;
39     }
40
41     /**
42      * Sets the name of the page variable that the ActionFlowAction will be stored
43      * under in the pageContext and also published via the TEI class.
44      *
45      * @param var The name of the page variable of the repository item
46      */

47     public void setVar(String JavaDoc var) {
48         this.var = var;
49     }
50
51     /**
52      * Retrieves the ActionFlowAction from the request and then stores it in the
53      * page context.
54      *
55      * @return Always returns SKIP_BODY
56      */

57     public int doStartTag() {
58
59         ActionFlowAction action = (ActionFlowAction)
60             pageContext.getRequest().getAttribute(ActionFlowConstants.ACTION_REQUEST_KEY);
61         if (action != null) {
62             pageContext.setAttribute(var, action);
63         }
64
65         return SKIP_BODY;
66     }
67 }
68
Popular Tags