action类
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
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.sshDemo.hibernate.UserInfo;
import com.sshDemo.hibernate.UserInfoDAO;
import com.yourcompany.struts.form.LoginForm;
/**
* MyEclipse Struts
* Creation date: 07-24-2007
*
* XDoclet definition:
* @struts.action path="/login" name="loginForm" input="/login.jsp" scope="request" validate="true"
*/
public class LoginAction extends Action {
/*
* Generated Methods
*/
private UserInfoDAO loginDao;
public UserInfoDAO getLogin(){
return loginDao;
}
public void setLoginDao(UserInfoDAO loginDao)
{
this.loginDao = loginDao;
}
/**
* 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
UserInfo lo = this.loginDao.findById(1);
System.out.print(lo.getUserName());
return null;
}
}
[此贴子已经被作者于2007-7-25 0:22:54编辑过]