PageBean
public class PageBean<T> {
private List<T> list; //联系人列表
private int curPage;//当前页码
private int sumPage;//总页码
private int count;//总数量
private int curSize;//一页显示的数量
}
模块Servlet
使用反射优化方法调用
try {
//处理乱码
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
//获得method请求参数
String methodStr = request.getParameter("method");
Method m= this.getClass().getDeclaredMethod(methodStr, HttpServletRequest.class, HttpServletResponse.class);
m.invoke(this,request,response);
} catch (Exception e) {
e.printStackTrace();
}