//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.4/xslt/JavaClass.xsl

package com.yourcompany.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.yourcompany.struts.form.LoginForm;

/** 
 * MyEclipse Struts
 * Creation date: 04-18-2005
 * 
 * XDoclet definition:
 * @struts:action path="/login" name="loginForm" input="/form/login.jsp" scope="request" validate="true"
 */
public class LoginAction extends Action {

	// --------------------------------------------------------- Instance Variables

	// --------------------------------------------------------- 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;
		String userName = (String)loginForm.getUserName();
		String password = (String)loginForm.getPassword();
		if (userName.equals("admin") && password.equals("admin"))
		{
			return mapping.findForward("success");
		}
		else
		{
			return mapping.findForward("fail");
		}
	}

}