1 7 package com.inversoft.verge.mvc.view.jsp.form; 8 9 10 import java.io.IOException ; 11 12 import javax.servlet.jsp.JspException ; 13 import javax.servlet.jsp.PageContext ; 14 15 import com.inversoft.verge.mvc.MVCConstants; 16 import com.inversoft.verge.mvc.controller.form.FormURLTools; 17 import com.inversoft.verge.mvc.view.HtmlViewToolkit; 18 19 20 29 public class FormHelper { 30 31 40 public static final FormTag getFormTag(com.inversoft.verge.mvc.view.jsp.html.FormTag formTag) 41 throws JspException { 42 43 try { 44 return (FormTag) formTag; 45 } catch (ClassCastException cce) { 46 throw new JspException ("Form controller tags must be inside a Form" + 47 " MVC form tag"); 48 } 49 } 50 51 52 58 public static void outputControllerExtra(String name, String action, 59 PageContext pageContext) 60 throws JspException { 61 StringBuffer buf = new StringBuffer (); 62 String parameter = FormURLTools.generateSubmitParameter(name, action); 63 HtmlViewToolkit.appendHiddenTag(buf, FormURLTools.SUBMIT_PARAMETER, 64 parameter); 65 66 try { 67 pageContext.getOut().print(buf.toString()); 68 } catch (IOException ioe) { 69 throw new JspException (ioe); 70 } 71 } 72 } | Popular Tags |