1 package net.sourceforge.formview.usecases.action; 2 3 import javax.servlet.http.HttpServletRequest ; 4 import javax.servlet.http.HttpServletResponse ; 5 6 import org.apache.struts.action.ActionForm; 7 import org.apache.struts.action.ActionForward; 8 import org.apache.struts.action.ActionMapping; 9 10 import net.sourceforge.formview.struts.action.FormViewDispatchAction; 11 import net.sourceforge.formview.usecases.form.DisplayerConfigForm; 12 import net.sourceforge.formview.util.WEBFormViewUtil; 13 14 22 public class DisplayerConfigAction extends FormViewDispatchAction { 23 24 public ActionForward load(ActionMapping mapping, ActionForm actionForm, 25 HttpServletRequest request, HttpServletResponse response) throws Exception { 26 DisplayerConfigForm form = (DisplayerConfigForm)actionForm; 27 28 form.setHTMLInputText("HTMLInputText value"); 29 form.setHTMLInputCheckbox(""); 30 form.setHTMLTextarea("HTMLTextarea value"); 31 32 return display( mapping, actionForm, request, response); 33 } 34 35 public ActionForward display(ActionMapping mapping, ActionForm actionForm, 36 HttpServletRequest request, HttpServletResponse response) throws Exception { 37 38 return mapping.findForward("display"); 39 } 40 41 public ActionForward changeState(ActionMapping mapping, ActionForm actionForm, 42 HttpServletRequest request, HttpServletResponse response) throws Exception { 43 DisplayerConfigForm form = (DisplayerConfigForm)actionForm; 44 String state = form.getState(); 45 WEBFormViewUtil.saveState(request, getServlet().getServletContext(), state); 47 48 return mapping.findForward("display"); 49 } 50 51 } 52 | Popular Tags |