LoginAction.java
上传用户:jishiqi_cj
上传日期:2022-08-08
资源大小:24765k
文件大小:1k
- package classmate;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import org.apache.struts.action.Action;
- import org.apache.struts.action.ActionForm;
- import org.apache.struts.action.ActionForward;
- import org.apache.struts.action.ActionMapping;
- public final class LoginAction extends Action{
- public ActionForward execute(
- ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws Exception {
-
-
- UserForm userform = (UserForm) form;
- String name = userform.getName();
- String psw = userform.getPsw();
-
- if("jenny".equals(name) && "hi".equals(psw)){
- UserLoginLog ul = new UserLoginLog();
- ul.save(name,psw);
- return mapping.findForward("successed");
- }else{
- return mapping.findForward("failed");
- }
- }
- }