(Struts )ATM 之 LoginAction

/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.niceo.atm.struts.action;

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;
import com.niceo.atm.struts.form.LoginForm;

/** 
 * MyEclipse Struts
 * Creation date: 05-22-2008
 * 
 * XDoclet definition:
 * @struts.action path="/login" name="loginForm" input="/login.jsp" scope="request" validate="true"
 * @struts.action-forward name="success" path="/success.jsp"
 * @struts.action-forward name="failure" path="/failure.jsp"
 */
public class LoginAction extends Action {
	/*
	 * Generated Methods
	 */

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		LoginForm loginForm = (LoginForm) form;
		// TODO Auto-generated method stub
		String crads=loginForm.getCrads_id();
		String crads_pwd=loginForm.getCrads_pwd();
		if(crads.equals("niceo")){
			mapping.findForward("success");
		}
		return mapping.findForward("failure");
	}
}

 

你可能感兴趣的:(apache,jsp,struts,MyEclipse,servlet)