switchpageaction.java

来自「软件开发过程通常包括五个阶段:分析、设计、编码、测试和发布。如果在Web应用开发」· Java 代码 · 共 47 行

JAVA
47
字号
/* * SwitchPageAction.java * * Created on 2005年3月1日, 下午2:10 */package test.action;import org.apache.struts.action.*;import javax.servlet.http.*;import test.bean.UserName;/* * @author LiuPOPO */public class SwitchPageAction extends Action{        /** Creates a new instance of SwitchPageAction */    public SwitchPageAction() {    }    public ActionForward execute(ActionMapping mapping,             ActionForm form,            HttpServletRequest request,            HttpServletResponse response)             throws Exception {        ActionForward retValue;                SwitchPageForm switchPageForm = (SwitchPageForm)form;        UserName userName = new UserName();        userName.setId(switchPageForm.getId());        if(userName.getName().equals("your name is A")){            retValue = mapping.findForward("a");        } else if(userName.getName().equals("your name is B")){            retValue = mapping.findForward("b");        } else if(userName.getName().equals("your name is C")){            retValue = mapping.findForward("c");        } else {            retValue = mapping.findForward("other");        }                return retValue;    }    }

⌨️ 快捷键说明

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