com.jsj.web.manage====新闻发布系统(11)
2021-03-06 09:29
标签:xtend name refresh use etc ges error ext manage 2020-05-15 这个是管理员的Servlet ManageServlet NewsCateServlet NewsServlet PublishNewsServlet com.jsj.web.manage====新闻发布系统(11) 标签:xtend name refresh use etc ges error ext manage 原文地址:https://www.cnblogs.com/quenvpengyou/p/12896542.html 1 package com.jsj.web.manage;
2
3 import javax.servlet.ServletException;
4 import javax.servlet.annotation.WebServlet;
5 import javax.servlet.http.HttpServlet;
6 import javax.servlet.http.HttpServletRequest;
7 import javax.servlet.http.HttpServletResponse;
8 import java.io.IOException;
9
10 @WebServlet("/admin/manage")
11 public class ManageServlet extends HttpServlet {
12
13 protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
14 request.getRequestDispatcher("/WEB-INF/view/admin/manage/index.jsp").forward(request,response);
15 }
16 }
1 package com.jsj.web.manage;
2
3 import com.jsj.entity.NewsCate;
4 import com.jsj.factory.ServiceFactory;
5 import com.jsj.service.NewsCateService;
6
7 import javax.servlet.ServletException;
8 import javax.servlet.annotation.WebServlet;
9 import javax.servlet.http.HttpServlet;
10 import javax.servlet.http.HttpServletRequest;
11 import javax.servlet.http.HttpServletResponse;
12 import java.io.IOException;
13 import java.io.PrintWriter;
14 import java.util.List;
15
16 @WebServlet("/admin/manage/newsCate")
17 public class NewsCateServlet extends HttpServlet {
18
19 private NewsCateService newsCateService = (NewsCateService) ServiceFactory.getService("NewsCateService");
20
21 protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
22 List
1 package com.jsj.web.manage;
2
3 import com.jsj.entity.NewsVo;
4 import com.jsj.entity.Page;
5 import com.jsj.factory.ServiceFactory;
6 import com.jsj.service.NewsService;
7
8 import javax.servlet.ServletException;
9 import javax.servlet.annotation.WebServlet;
10 import javax.servlet.http.HttpServlet;
11 import javax.servlet.http.HttpServletRequest;
12 import javax.servlet.http.HttpServletResponse;
13 import java.io.IOException;
14 import java.io.PrintWriter;
15
16 @WebServlet("/admin/manage/news")
17 public class NewsServlet extends HttpServlet {
18
19 private NewsService newsService = (NewsService) ServiceFactory.getService("NewsService");
20
21 protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
22 try{
23 int pageIndex = request.getParameter("pageIndex") == null ? 1 : Integer.valueOf(request.getParameter("pageIndex"));
24 int pageSize = 10;
25 Page
1 package com.jsj.web.manage;
2
3 import com.jsj.entity.Admin;
4 import com.jsj.entity.News;
5 import com.jsj.entity.NewsCate;
6 import com.jsj.factory.ServiceFactory;
7 import com.jsj.service.NewsCateService;
8 import com.jsj.service.NewsService;
9
10 import javax.servlet.ServletException;
11 import javax.servlet.annotation.WebServlet;
12 import javax.servlet.http.HttpServlet;
13 import javax.servlet.http.HttpServletRequest;
14 import javax.servlet.http.HttpServletResponse;
15 import java.io.IOException;
16 import java.io.PrintWriter;
17 import java.util.Date;
18 import java.util.List;
19
20 @WebServlet("/admin/manage/publish")
21 public class PublishNewsServlet extends HttpServlet {
22
23 private NewsCateService newsCateService = (NewsCateService) ServiceFactory.getService("NewsCateService");
24
25 private NewsService newsService = (NewsService) ServiceFactory.getService("NewsService");
26
27 protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
28 List
文章标题:com.jsj.web.manage====新闻发布系统(11)
文章链接:http://soscw.com/essay/60803.html