/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.accp.web.action;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import com.accp.web.form.LoginForm;
/**
* MyEclipse Struts Creation date: 07-31-2008
*
* XDoclet definition:
*
* @struts.action path="/login" name="loginForm" input="/login.jsp"
* parameter="opt" scope="request" validate="true"
*/
public class LoginAction extends DispatchAction {
/*
* Generated Methods
*/
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward login(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
LoginForm loginForm = (LoginForm) form;
String name = request.getParameter("uname");
String pass = request.getParameter("pass");
System.out.println("name:"+name+" pass:"+pass);
PrintWriter out = null;
try {
out = response.getWriter();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (name.equals("admin") && pass.equals("admin")) {
out.print("true");
}else{
out.print("false");
}
return null;
}
}