KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.io.IOException JavaDoc;
11
12 import javax.servlet.jsp.JspException JavaDoc;
13 import javax.servlet.jsp.PageContext JavaDoc;
14
15 import com.inversoft.verge.mvc.MVCConstants;
16 import com.inversoft.verge.mvc.controller.actionflow.ActionFlowMetaData;
17 import com.inversoft.verge.mvc.controller.actionflow.ActionFlowURLTools;
18 import com.inversoft.verge.mvc.view.HtmlViewToolkit;
19
20
21 /**
22  * <p>
23  * This class is a helper for ActionFlow MVC custom tags
24  * </p>
25  *
26  * @author Brian Pontarelli
27  * @since 2.0
28  * @version 2.0
29  */

30 public class ActionFlowHelper {
31
32     /**
33      * Outputs the extra controller information to the JspWriter in the PageContext
34      * given, using the information in the tag given. This assumes that the
35      * handler type is equal to the constant {@link MVCConstants#ACTIONFLOW_NAME
36      * MVCConstants#ACTIONFLOW_NAME}
37      */

38     public static void outputControllerExtra(String JavaDoc name, String JavaDoc action,
39             PageContext JavaDoc pageContext, ActionFlowMetaData metaData)
40     throws JspException JavaDoc {
41         StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
42         String JavaDoc parameter = ActionFlowURLTools.generateSubmitParameter(name,
43             action, metaData.getEntry(), metaData.getExtraParams());
44         HtmlViewToolkit.appendHiddenTag(buf, ActionFlowURLTools.SUBMIT_PARAMETER,
45             parameter);
46
47         try {
48             pageContext.getOut().print(buf.toString());
49         } catch (IOException JavaDoc ioe) {
50             throw new JspException JavaDoc(ioe);
51         }
52     }
53 }
Popular Tags