LogonAction.java~4~
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- package firststrut;
- import org.apache.struts.action.*;
- import javax.servlet.http.*;
- import javax.servlet.*;
- public class LogonAction extends Action {
- public ActionForward perform(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) {
- //cast to LogonForm
- LogonForm lgForm=(LogonForm)actionForm;
- //
- String username=lgForm.getUsername();
- String password=lgForm.getPassword();
- //apply the biz logic
- if(username.equals("lsb")&& password.equals("bsl")){
- //return actionForward for success
- return (actionMapping.findForward("success"));
- }else{
- return actionMapping.findForward(actionMapping.getInput());
- }
- }
- }