choiceaction.java

来自「struts的表单介绍和用法.还有其他的用法」· Java 代码 · 共 75 行

JAVA
75
字号
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.7.200/xslt/JavaClass.xslpackage com.nscorp.action;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import java.io.IOException;import javax.servlet.ServletException;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionForward;import org.apache.struts.action.ActionMapping;import org.apache.struts.actions.LookupDispatchAction;import java.util.*;/**  * MyEclipse Struts * Creation date: 08-16-2004 *  * XDoclet definition: * @struts:action path="/ChoiceAction" name="ChoiceForm" input="/jsp/Choice.jsp" scope="request" * @struts:action-forward name="/ChoiceTwo.jsp" path="/ChoiceTwo.jsp" * @struts:action-forward name="/ChoiceOne.jsp" path="/ChoiceOne.jsp" * @struts:action-forward name="/ChoiceThree.jsp" path="/ChoiceThree.jsp" */public class ChoiceAction extends LookupDispatchAction {	// --------------------------------------------------------- Instance Variables	// --------------------------------------------------------- Methods    public ActionForward path_one(ActionMapping mapping,            ActionForm form,            HttpServletRequest request,            HttpServletResponse response)        throws IOException, ServletException    {        return (mapping.findForward("choice_one"));    }    public ActionForward path_two(ActionMapping mapping,            ActionForm form,            HttpServletRequest request,            HttpServletResponse response)        throws IOException, ServletException    {        return (mapping.findForward("choice_two"));    }    public ActionForward path_three(ActionMapping mapping,            ActionForm form,            HttpServletRequest request,            HttpServletResponse response)        throws IOException, ServletException    {        return (mapping.findForward("choice_three"));    }    protected Map getKeyMethodMap()    {        Map map = new HashMap();        map.put("button.pathone", "path_one");        map.put("button.pathtwo", "path_two");        map.put("button.paththree", "path_three");          return(map);    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?