ArtManage.java
上传用户:wlfwy2004
上传日期:2016-12-12
资源大小:33978k
文件大小:2k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. package com.opensource.blog.web.action;
  2. import javax.servlet.http.HttpServletRequest;
  3. import javax.servlet.http.HttpServletResponse;
  4. import org.apache.struts.action.ActionForm;
  5. import org.apache.struts.action.ActionForward;
  6. import org.apache.struts.action.ActionMapping;
  7. import com.laoer.comm.web.PageList;
  8. import com.laoer.comm.web.Pages;
  9. import com.opensource.blog.service.ArticleService;
  10. import com.opensource.blog.web.form.ArtManageForm;
  11. import com.opensource.blog.web.servlet.UserSession;
  12. public class ArtManage
  13.     extends BaseAction {
  14.   private ArticleService articleService;
  15.   public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm,
  16.                                HttpServletRequest servletRequest,
  17.                                HttpServletResponse servletResponse) {
  18.     ArtManageForm form = (ArtManageForm) actionForm;
  19.     UserSession us = this.getUserSession(servletRequest);
  20.     Pages pages = new Pages(servletRequest.getLocale());
  21.     pages.setPage(form.getPage());
  22.     pages.setPerPageNum(us.getBlog().getPerartnum());
  23.     pages.setStyle(1);
  24.     pages.setFileName("artManage.do");
  25.     PageList pl = this.getArticleService().findArticlesByBlogID(us.getBlog().getId().longValue(),
  26.         pages);
  27.     servletRequest.setAttribute("pl", pl);
  28.     return actionMapping.findForward("artmanage");
  29.   }
  30.   public ArticleService getArticleService() {
  31.     return articleService;
  32.   }
  33.   public void setArticleService(ArticleService articleService) {
  34.     this.articleService = articleService;
  35.   }
  36. }