Struts1 action跳转action
Strus1最后一次维护是2008年了.真坑爹,我们项目要用,领导说struts1用懂了struts2不是事,但是这个过程不是可逆的,那就好好学吧
第一个任务刚刚完成好兴奋!大概意思是其他页面要调用我们系统的action,但是他们不想用我们的输入条件页面,参数通过url给我传递,我要在自己的action中做一个假登录来骗过已经写好的action,然后调用那个action的方法
1 public ActionForward execute(ActionMapping mapping, ActionForm form, 2 HttpServletRequest request, HttpServletResponse response) 3 throws Exception 4 { 5 System.out.println("------- 开始调用华夏银行需求Action ReportEntOutAction -------"); 6 if (log.isDebugEnabled()) 7 { 8 log.debug("enter queryreport"); 9 } 10 //接收页面参数 11 String loancardno = request.getParameter("loancardno");//贷款卡编码 12 String password = request.getParameter("password");//贷款卡密码 13 String reason = request.getParameter("queryReason");//查询原因 14 String qformat = request.getParameter("qformat");//查询版式 15 String userId = request.getParameter("userId");//内部用户id 16 String userPassword = request.getParameter("userPassword");//内部用户密码 17 18 19 //获取LogonService,用LogonService进行登录逻辑判断,是否锁定,是否停用等 20 ILogonService service = (ILogonService) PICPStartup.getInstance() 21 .getBeanFromSpring("LogonService"); 22 LoginInfo loginInfo = new LoginInfo(); 23 loginInfo.setUserID(userId);// 用户名 24 loginInfo.setPassword(userPassword);// 密码 25 loginInfo.setLoginIp(request.getRemoteAddr());// 请求IP 26 try 27 { 28 service.login(loginInfo); 29 request.getSession().setAttribute(Constants.LOGININFO, loginInfo); 30 } 31 catch (Exception e) 32 { 33 e.printStackTrace(); 34 } 35 System.out.println("------ 用户伪登陆成功 ------"); 36 37 //设置各个默认值 38 String queryType = "2";//查询方式:1MQ/2WS 39 String flag = "N";//是否可以查询本地当前表数据,默认每次都查征信端 40 return new ActionForward("/ReportEntAction.do?method=queryreport&loancardno=" 41 + loancardno 42 + "&password=" 43 + password 44 + "&reason=" 45 + reason 46 + "&qformat=" 47 + qformat 48 + "&tranType=" 49 + queryType 50 + "&zxuserid=&zxpwssd=" + 51 "&querydate=" + 52 "&flag=" + flag 53 ); 54 }