• [织梦吧]唯一域名:www.dedecms8.com,织梦DedeCMS学习平台.

当前位置: > 编程与数据库 > Jsp编程 >

JSP中MVC模式的Demo(4)

来源: www.dedecms8.com 编辑:织梦吧 时间:2012-06-28点击:

  <%

  } www.2cto.com

  %>

  </table>

 

UserDL.java是个专门用于分页的Servlet

 

public void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

System.out.println("通过Servlet分页");

String s_pageNow = request.getParameter("pageNow");

UserBeanDL ubd = new UserBeanDL();

try{

int pageNow = Integer.parseInt(s_pageNow);

ArrayList al = ubd.getUsersByPage(pageNow);

int pageCount = ubd.getPageCount();

request.setAttribute("pageNow", pageNow);

request.setAttribute("result", al);

request.setAttribute("pageCount", pageCount + "");

request.getRequestDispatcher("threedown/welcome.jsp").forward(request, response);

}catch(Exception e){

e.printStackTrace();

}

}

 

标签: jsp

About D8

  • ©2014 织梦吧(d8) DedeCMS学习交流平台
  • 唯一网址 www.DedeCMS8.com 网站地图
  • 联系我们 1170734538@qq.com ,  QQ