实现s1sh


ation 

package cn.com.webapp.action;

import java.util.List;

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 cn.com.manager.PersonManager;

public class PersonAction extends DispatchAction{

private PersonManager personManager;

public void setPersonManager(PersonManager personManager) {
this.personManager = personManager;
}
    //��ʾ���е����
public ActionForward findAll(ActionMapping mapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse response) throws Exception {
System.out.println("到这里了啊");
List list = personManager.findAll();
System.out.println("Action list   "+list.size());
request.setAttribute("data", list);
return mapping.findForward("person_list");
}



}



form bean


package cn.com.webapp.form;

import org.apache.struts.action.ActionForm;
/**
* ���� ��װ����ҳ������
*
*
* @author Administrator
*
*/
public class PersonForm extends ActionForm{

/**
*
*/
private static final long serialVersionUID = 1L;
private String personName ;
private String personPassword;
public String getPersonName() {
return personName;
}
public void setPersonName(String personName) {
this.personName = personName;
}
public String getPersonPassword() {
return personPassword;
}
public void setPersonPassword(String personPassword) {
this.personPassword = personPassword;
}



}

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