?? loginaction.java
字號:
package cn.com.ahead.A6;import org.apache.struts.action.*;import javax.servlet.http.*;public class loginAction extends KrmAction { public ActionForward perform(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { inilog(); loginActionForm myaf=(loginActionForm)actionForm; String name=myaf.getUsername(); String password=myaf.getPassword(); System.out.println("user:"+name+" password:"+password); ActionErrors errors = new ActionErrors(); Transaction ts = new Transaction("KRMA6"); ts.setTSCODE("login"); ts.setParameter("NAME", name.toString()); ts.setParameter("PWD",password.toString()); if(!(ts.commit())){ errors.add("login_Message", new ActionError("login.error")); saveErrors(httpServletRequest, errors); //保存錯誤信息 return (new ActionForward(actionMapping.getInput())); //如果有錯誤則返回 取自struts-config }else{ return actionMapping.findForward("ok"); } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -