精华内容
下载资源
问答
  • javaweb新闻管理系统

    2020-02-16 04:53:31
    新闻管理系统提供以下功能: 1. 查看所有新闻:管理员可以浏览存放在数据库内的所有新闻,包括新闻的ID、标题、内容以及发布的时间。 2. 添加新闻:管理员可以将最新的新闻添加进数据库,供用户浏览。 3. 修改...
  • JavaWeb新闻管理系统

    2018-11-08 10:57:06
    能运行的JavaWeb项目,其中包括源码和数据库,适合初学JavaWeb的同学作为参考资料
  • javaWeb新闻管理系统的补充jar包,据下载后用户反馈,补充完善代码,有需要者可自行下载。此为新闻管理系统附带jar包,单独下载无用。
  • 由于之前系统出现部分问题,特做了修改,编辑器请使用idea,请附带下载相关jar包,操作放法见文章。数据库只需去文章中找到数据库文件,复制以后使用数据库可视化工具运行即可
  • 之前的jar包中缺少了HttpServelet的相关jar包,如需jar包,请使用2.0版,相关操作方式见文章,如需更高级别的项目,请联系我,相关FY可详谈,包讲解,如有需要,请使用文章中的添加方式
  • javaweb简易新闻管理系统代码
  • javaWeb项目之新闻管理系统

    千次阅读 多人点赞 2019-07-02 19:58:48
    javaWeb项目之新闻管理系统 一、后台代码 src/com/news/bean/NewsComment.java package com.news.bean; import java.sql.Date; public class NewsComment { private int id; private int newsid; ...

    javaWeb项目之新闻管理系统

    这是csdn保存的源码,如有需要,可自行下载:https://download.csdn.net/download/fzt12138/11776339
    另外,根据各位下载后的反馈,系统中缺少jar包,现已补齐,下载地址为:https://download.csdn.net/download/fzt12138/13206785
    如有需要,可自行下载,该系统为MySQL数据库,idea开发。
    关于如何导入项目,请见https://blog.csdn.net/qq_42986107/article/details/88412386
    数据库文件https://download.csdn.net/download/fzt12138/13206806

    最近看到很多人在咨询我这个系统的事,我又写了一篇详细的开发步骤文章,欢迎阅读javaWeb项目之新闻管理系统详细开发过程

    一、后台代码

    ①文件路径

    src/com/news/bean/NewsComment.java

    package com.news.bean;
    
    import java.sql.Date;
    
    public class NewsComment {
        private int id;
        private int newsid;
        private String content;
        private String author;
        private Date createdate;
    
        @Override
        public String toString() {
            return  newsid +
                    "," + content+
                    "," + author+
                    "," + createdate;
        }
    
        public int getId() {
            return id;
        }
    
        public void setId(int id) {
            this.id = id;
        }
    
        public int getNewsid() {
            return newsid;
        }
    
        public void setNewsid(int newsid) {
            this.newsid = newsid;
        }
    
        public String getContent() {
            return content;
        }
    
        public void setContent(String content) {
            this.content = content;
        }
    
        public String getAuthor() {
            return author;
        }
    
        public void setAuthor(String author) {
            this.author = author;
        }
    
        public Date getCreatedate() {
            return createdate;
        }
    
        public void setCreatedate(Date createdate) {
            this.createdate = createdate;
        }
    }
    
    

    src/com/news/bean/NewsDetail.java

    package com.news.bean;
    
    import java.sql.Date;
    
    public class NewsDetail {
        private int id;
        private String title;
        private String summary;
        private String author;
        private Date createdate;
        public String toString1() {
            return title+
                    "," + summary+
                    "," + author +
                    "," + createdate;
        }
        @Override
        public String toString() {
            return "NewsDetail{" +
                    "id=" + id +
                    ", title='" + title + '\'' +
                    ", summary='" + summary + '\'' +
                    ", author='" + author + '\'' +
                    ", createdate=" + createdate +
                    '}';
        }
    
        public int getId() {
            return id;
        }
    
        public void setId(int id) {
            this.id = id;
        }
    
        public String getTitle() {
            return title;
        }
    
        public void setTitle(String title) {
            this.title = title;
        }
    
        public String getSummary() {
            return summary;
        }
    
        public void setSummary(String summary) {
            this.summary = summary;
        }
    
        public String getAuthor() {
            return author;
        }
    
        public void setAuthor(String author) {
            this.author = author;
        }
    
        public Date getCreatedate() {
            return createdate;
        }
    
        public void setCreatedate(Date createdate) {
            this.createdate = createdate;
        }
    }
    
    

    src/com/news/bean/PageBean.java

    package com.news.bean;
    
    public class PageBean {
        private int currPage=1;
        private int totalPage;
        private int size=4;
        private int count;
        private String title;
    
        public String getTitle() {
            return title;
        }
    
        public void setTitle(String title) {
            this.title = title;
        }
    
        public int getCurrPage() {
            return currPage;
        }
    
        public void setCurrPage(int currPage) {
            this.currPage = currPage;
        }
    
        public int getTotalPage() {
            return totalPage;
        }
    
        public void setTotalPage(int totalPage) {
            this.totalPage = totalPage;
        }
    
        public int getSize() {
            return size;
        }
    
        public void setSize(int size) {
            this.size = size;
        }
    
        public int getCount() {
            return count;
        }
    
        public void setCount(int count) {
            this.count = count;
        }
    
    }
    
    

    src/com/news/bean/PinLun.java

    package com.news.bean;
    
    import java.sql.Date;
    
    public class PinLun {
    private int id;
    private Date createdate;
    
        public Date getCreatedate() {
            return createdate;
        }
    
        public void setCreatedate(Date createdate) {
            this.createdate = createdate;
        }
    
        public int getId() {
            return id;
        }
    
        public void setId(int id) {
            this.id = id;
        }
    
        private int newsid;
    
        @Override
        public String toString() {
            return content+
                    "," + author;
        }
    
        public int getNewsid() {
            return newsid;
        }
    
        public void setNewsid(int newsid) {
            this.newsid = newsid;
        }
    
        private String content;
    private String author;
    
    
    
        public String getContent() {
            return content;
        }
    
        public void setContent(String content) {
            this.content = content;
        }
    
        public String getAuthor() {
            return author;
        }
    
        public void setAuthor(String author) {
            this.author = author;
        }
    
    
    }
    
    

    src/com/news/dao/impl/NewsDaoImpl.java

    package com.news.dao.impl;
    
    import com.news.bean.NewsDetail;
    import com.news.bean.PageBean;
    import com.news.dao.INewsDao;
    import com.news.utils.JdbcUtil;
    import org.apache.commons.dbutils.QueryRunner;
    import org.apache.commons.dbutils.handlers.BeanListHandler;
    import org.apache.commons.dbutils.handlers.ScalarHandler;
    
    import java.util.List;
    
    public class NewsDaoImpl implements INewsDao {
        @Override
        public List<NewsDetail> selectLikePage(PageBean page) {
            QueryRunner qr = new QueryRunner(JdbcUtil.getDS());
            int startRow=(page.getCurrPage()-1)*page.getSize();
            String sql="select * from news_detail where 1=1";
            if(page.getTitle()!=null&&!page.getTitle().equals("")){
            sql+=" and title like '%"+page.getTitle()+"%'";
            }
            sql+=" limit ?,?";
            try {
                return qr.query(sql,new BeanListHandler<NewsDetail>(NewsDetail.class),startRow,page.getSize());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    
        @Override
        public int selectCount() {
            QueryRunner qr = new QueryRunner(JdbcUtil.getDS());
            try {
                return qr.query("select count(*) from news_detail",new ScalarHandler<Long>()).intValue();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
    
    

    src/com/news/dao/impl/PinLunDaoImpl.java

    package com.news.dao.impl;
    
    import com.news.bean.PinLun;
    import com.news.dao.IPinLunDao;
    import com.news.utils.JdbcUtil;
    import org.apache.commons.dbutils.QueryRunner;
    import org.apache.commons.dbutils.handlers.BeanListHandler;
    
    import java.sql.SQLException;
    import java.util.Date;
    import java.util.List;
    
    public class PinLunDaoImpl implements IPinLunDao {
        @Override
        public List<PinLun> selectPinLun(String id) {
            QueryRunner qr = new QueryRunner(JdbcUtil.getDS());
            try {
                return qr.query("select * from news_comment where newsid=?",new BeanListHandler<PinLun>(PinLun.class),id);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    
        @Override
        public int addPinLun(PinLun pinlun) {
            QueryRunner qr = new QueryRunner(JdbcUtil.getDS());
            Date date = new Date();
            try {
                return qr.update("insert into news_comment(newsid,content,author,createdate) values(?,?,?,?)",pinlun.getId(),pinlun.getContent(),pinlun.getAuthor(),date);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
    
        }
    
        @Override
        public int delete(String id) {
            QueryRunner qr = new QueryRunner(JdbcUtil.getDS());
            try {
                qr.update("delete from news_comment where newsid=?",id);
                return qr.update("delete from news_detail where id=?",id);
            } catch (SQLException e) {
                throw new RuntimeException(e);
            }
        }
    }
    
    

    src/com/news/dao/INewsDao.java

    package com.news.dao;
    
    import com.news.bean.NewsDetail;
    import com.news.bean.PageBean;
    
    import java.util.List;
    
    public interface INewsDao {
        List<NewsDetail> selectLikePage(PageBean page);
    
        int selectCount();
    }
    
    

    src/com/news/dao/IPinLunDao.java

    package com.news.dao;
    
    import com.news.bean.PinLun;
    
    import java.util.List;
    
    public interface IPinLunDao {
        List<PinLun> selectPinLun(String id);
    
        int addPinLun(PinLun pinlun);
    
        int delete(String id);
    }
    
    

    src/com/news/service/impl/NewsServiceImpl.java

    package com.news.service.impl;
    
    import com.news.bean.NewsDetail;
    import com.news.bean.PageBean;
    import com.news.dao.INewsDao;
    import com.news.dao.impl.NewsDaoImpl;
    import com.news.service.INewsService;
    
    import java.util.List;
    
    public class NewsServiceImpl implements INewsService {
        private INewsDao dao=new NewsDaoImpl();
    
        @Override
        public List<NewsDetail> selectLikePage(PageBean page) {
            int count=dao.selectCount();
            int totalPage=(count%4==0)?(count/4):(count/4+1);
            page.setCount(count);
            page.setTotalPage(totalPage);
            return dao.selectLikePage(page);
        }
    }
    
    

    src/com/news/service/impl/PinLunServiceImpl.java

    package com.news.service.impl;
    
    import com.news.bean.PinLun;
    import com.news.dao.IPinLunDao;
    import com.news.dao.impl.PinLunDaoImpl;
    import com.news.service.IPinLunService;
    
    import java.util.List;
    
    public class PinLunServiceImpl implements IPinLunService {
        private IPinLunDao dao=new PinLunDaoImpl();
        @Override
        public List<PinLun> selectPinLun(String id) {
            return dao.selectPinLun(id);
        }
    
        @Override
        public int addPinLun(PinLun pinlun) {
            return dao.addPinLun(pinlun);
        }
    
        @Override
        public int delete(String id) {
            return dao.delete(id);
        }
    
    }
    
    

    src/com/news/service/INewsService.java

    package com.news.service;
    
    import com.news.bean.NewsDetail;
    import com.news.bean.PageBean;
    
    import java.util.List;
    
    public interface INewsService {
        List<NewsDetail> selectLikePage(PageBean page);
    }
    
    

    src/com/news/service/IPinLunService.java

    package com.news.service;
    
    import com.news.bean.PinLun;
    
    import java.util.List;
    
    public interface IPinLunService {
        List<PinLun> selectPinLun(String id);
        int addPinLun(PinLun pinlun);
    
        int delete(String id);
    }
    
    

    src/com/news/utils/JdbcUtil.java

    package com.news.utils;
    
    import com.mchange.v2.c3p0.ComboPooledDataSource;
    import org.apache.commons.beanutils.BeanUtils;
    import org.apache.commons.beanutils.ConvertUtils;
    import org.apache.commons.beanutils.converters.SqlDateConverter;
    
    import javax.sql.DataSource;
    import java.util.Map;
    
    public class JdbcUtil {
        //读取c3p0配置文件中的参数 四大参数
        private static DataSource ds = new ComboPooledDataSource();
    
        public static DataSource getDS() {
            return ds;
        }
    
        static {
            ConvertUtils.register(new SqlDateConverter(null), java.sql.Date.class);
            ConvertUtils.register(new SqlDateConverter(null), java.util.Date.class);
        }
    
        public static <T> T mapToBean(Map map, Class<T> c) {
            try {
                T t = c.newInstance();
                BeanUtils.populate(t, map);
                return t;
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
    
    

    src/com/news/web/AddPinLunServlet.java

    package com.news.web;
    
    import com.news.bean.PinLun;
    import com.news.service.IPinLunService;
    import com.news.service.impl.PinLunServiceImpl;
    import com.news.utils.JdbcUtil;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.IOException;
    import java.util.Map;
    
    public class AddPinLunServlet extends HttpServlet {
    private IPinLunService service=new PinLunServiceImpl();
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
           request.setCharacterEncoding("utf-8");
            Map<String, String[]> map = request.getParameterMap();
            PinLun pinlun = JdbcUtil.mapToBean(map, PinLun.class);
            int i=service.addPinLun(pinlun);
            String msg=i==1?"新增成功!":"新增失败!";
            request.getSession().setAttribute("msg",msg);
            response.getWriter().write(msg);
            response.sendRedirect("/News/show");
        }
    
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            request.getRequestDispatcher("/jsp/addPinLun.jsp").include(request,response);
           // response.sendRedirect("/News/jsp/addPinLun.jsp");
    
        }
    }
    
    

    src/com/news/web/DeleteServlet.java

    package com.news.web;
    
    import com.news.service.IPinLunService;
    import com.news.service.impl.PinLunServiceImpl;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import java.io.IOException;
    
    public class DeleteServlet extends HttpServlet {
        IPinLunService service=new PinLunServiceImpl();
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    
        }
    
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String id = request.getParameter("id");
            int i=service.delete(id);
            HttpSession session = request.getSession();
            String msg=i==1?"<script>alert('删除成功!')</script>":"<script>alert('删除失败!')</script>";
            session.setAttribute("msg",msg);
            response.getWriter().write(msg);
            response.sendRedirect("/News/show");
        }
    }
    
    

    src/com/news/web/showPinLunServlet.java

    package com.news.web;
    
    import com.news.bean.PinLun;
    import com.news.service.IPinLunService;
    import com.news.service.impl.PinLunServiceImpl;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import java.io.IOException;
    import java.util.List;
    
    public class showPinLunServlet extends HttpServlet {
        private IPinLunService service=new PinLunServiceImpl();
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    
        }
    
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String id=request.getParameter("id");
           List<PinLun> list=service.selectPinLun(id);
            HttpSession session = request.getSession();
            session.setAttribute("list",list);
            request.getRequestDispatcher("/jsp/showPinLun.jsp").forward(request,response);
    
        }
    }
    
    

    src/com/news/web/ShowServlet.java

    package com.news.web;
    
    import com.news.bean.NewsDetail;
    import com.news.bean.PageBean;
    import com.news.service.INewsService;
    import com.news.service.impl.NewsServiceImpl;
    import com.news.utils.JdbcUtil;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.IOException;
    import java.util.List;
    import java.util.Map;
    
    public class ShowServlet extends HttpServlet {
        private PageBean page=new PageBean();
        private INewsService service=new NewsServiceImpl();
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    
        }
    
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
            Map<String, String[]> map = request.getParameterMap();
            page = JdbcUtil.mapToBean(map, PageBean.class);
            List<NewsDetail> list=service.selectLikePage (page);
            request.getSession().setAttribute("list",list);
            request.getSession().setAttribute("page",page);
            request.getRequestDispatcher("/jsp/show.jsp").forward(request,response);
        }
    }
    
    

    src/c3p0-config.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <c3p0-config>
        <!--默认配置-->
        <default-config>
            <property name="driverClass">com.mysql.jdbc.Driver</property>
            <property name="jdbcUrl">jdbc:mysql://localhost:3306/K9503?characterEncoding=utf-8</property>
            <property name="user">root</property>
            <property name="password">123456</property>
        </default-config>
    
    </c3p0-config>
    

    图片

    [外链图片转存失败(img-wF376FDS-1562068507980)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\1562067860616.png)]

    js插件

    [外链图片转存失败(img-cuw3bj8F-1562068507982)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\1562067886806.png)]

    二、前端代码:

    web/jsp/addPinLun.jsp

    <%--
      Created by IntelliJ IDEA.
      User: Administrator
      Date: 2019/6/10
      Time: 12:15
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>新闻管理系统</title>
    </head>
    <body>
    <hr color="bisque">
    <div>
        <div style="background-color: ghostwhite">
            <div style="width: 50px;float: left;margin: 15px auto auto 60px"><span style="font-family: kaiti;font-size: 25px;color: darkorchid">旧波新闻</span></div>
            [外链图片转存失败(img-ViCh7uhQ-1562068507983)(https://mp.csdn.net/img/bgimg2.jpg)]
            <span style="color: blue;font-family: kaiti;font-size: 50px;margin-left: 140px">欢迎访问旧波新闻!</span>
            <div style="float: right;margin-right: 100px">
                <ul style="list-style-type: none">
                    <li style="display:inline-block"><a href="/News/" style="color: black">首页/</a></li>
                    <li style="display:inline-block"><a href="/News/jsp/login.jsp" style="color: black">登录/</a></li>
                    <li style="display:inline-block"><a href="/News/jsp/register.jsp" style="color: black">注册</a></li>
                </ul>
            </div>
        </div>
    
        <h4 ><hr color="bisque"></h4>
        <div align="center">
            <h3>添加评论</h3>
            <form action="/News/addPinLun" method="post">
                评论内容:<textarea name="content" cols="30" rows="10" style="size: 50px"></textarea><br><br><br>
                评论人:<input type="text" name="author"><br><br><br>
                <input type="hidden" name="id" value="${param.id}">
                <input type="submit" value="添加">&emsp;&emsp;
                <input type="button" value="返回" οnclick="location.href='/News/show'">
            </form>
        </div>
    </div>
    </body>
    </html>
    
    

    web/jsp/login.jsp

    <%--
      Created by IntelliJ IDEA.
      User: Administrator
      Date: 2019/6/6
      Time: 16:07
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>新闻管理系统</title>
    </head>
    <body>
        <hr color="bisque">
        <div>
            <div style="background-color: ghostwhite">
                <div style="width: 50px;float: left;margin: 15px auto auto 60px"><span style="font-family: kaiti;font-size: 25px;color: darkorchid">旧波新闻</span></div>
                [外链图片转存失败(img-IH9gdq2i-1562068507985)(https://mp.csdn.net/img/bgimg2.jpg)]
                <span style="color: blue;font-family: kaiti;font-size: 50px;margin-left: 140px">欢迎访问旧波新闻!</span>
                <div style="float: right;margin-right: 100px">
                    <ul style="list-style-type: none">
                        <li style="display:inline-block"><a href="/News/" style="color: black">首页/</a></li>
                        <li style="display:inline-block"><a href="/News/jsp/login.jsp" style="color: black">登录/</a></li>
                        <li style="display:inline-block"><a href="/News/jsp/register.jsp" style="color: black">注册</a></li>
                    </ul>
                </div>
            </div>
    
            <h4 ><hr color="bisque"></h4>
    
            <div align="center" style="margin-top: 150px">
                <h3 align="center" style="color: cornflowerblue">用户登录</h3>
                <form action="/News/login" method="post">
                   用户名: <input type="text" name="user"><br><br>
                   密&nbsp;&nbsp;&nbsp;码: <input type="password" name="psw"><br><br>
                    <input type="submit" value="登录">&emsp;&emsp;&emsp;<input type="button" value="注册" οnclick="location.href='/News/jsp/register.jsp'">
    
                </form>
            </div>
        </div>
    </body>
    </body>
    </html>
    
    

    web/jsp/register.jsp

    <%--
      Created by IntelliJ IDEA.
      User: Administrator
      Date: 2019/6/6
      Time: 16:15
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>新闻管理系统</title>
    </head>
    <body>
    <hr color="bisque">
    <div>
        <div style="background-color: ghostwhite">
            <div style="width: 50px;float: left;margin: 15px auto auto 60px"><span style="font-family: kaiti;font-size: 25px;color: darkorchid">旧波新闻</span></div>
            [外链图片转存失败(img-WDwrAy7T-1562068507985)(https://mp.csdn.net/img/bgimg2.jpg)]
            <span style="color: blue;font-family: kaiti;font-size: 50px;margin-left: 140px">欢迎访问旧波新闻!</span>
            <div style="float: right;margin-right: 100px">
                <ul style="list-style-type: none">
                    <li style="display:inline-block"><a href="/News/" style="color: black">首页/</a></li>
                    <li style="display:inline-block"><a href="/News/jsp/login.jsp" style="color: black">登录/</a></li>
                    <li style="display:inline-block"><a href="/News/jsp/register.jsp" style="color: black">注册</a></li>
                </ul>
            </div>
        </div>
        <h4 ><hr color="bisque"></h4>
        <div align="center" style="margin-top: 150px">
            <h3 style="color: cornflowerblue">用户注册</h3>
            <form action="/News/register" method="post">
    
            </form>
        </div>
    </div>
    </body>
    </html>
    
    

    web/jsp/show.jsp

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%--
      Created by IntelliJ IDEA.
      User: Administrator
      Date: 2019/6/6
      Time: 16:20
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>新闻管理系统</title>
        <script src="/News/js/jquery-3.3.1.min.js"></script>
    </head>
    <body>
    <hr color="bisque">
    <div>
        <div style="background-color: ghostwhite">
            <div style="width: 50px;float: left;margin: 15px auto auto 60px"><span style="font-family: kaiti;font-size: 25px;color: darkorchid">旧波新闻</span></div>
            [外链图片转存失败(img-W4XgbHbp-1562068507986)(https://mp.csdn.net/img/bgimg2.jpg)]
            <span style="color: blue;font-family: kaiti;font-size: 50px;margin-left: 140px">欢迎访问旧波新闻!</span>
            <div style="float: right;margin-right: 100px">
                <ul style="list-style-type: none">
                    <li style="display:inline-block"><a href="/News/" style="color: black">首页/</a></li>
                    <li style="display:inline-block"><a href="/News/jsp/login.jsp" style="color: black">登录/</a></li>
                    <li style="display:inline-block"><a href="/News/jsp/register.jsp" style="color: black">注册</a></li>
                </ul>
            </div>
        </div>
    
        <h4 ><hr color="bisque"></h4>
        <div align="center">
            <form action="/News/show" method="post">
                <%--模糊查询区--%>
                新闻标题:<input type="text" name="title">
                    <input type="hidden" name="currPage" value="1">
                    <input type="submit" value="查询">
            </form>
            <div align="center">
                <table border="1" cellpadding="13" cellspacing="1">
                    <tr>
                        <td>新闻编号</td>
                        <td>新闻标题</td>
                        <td>新闻摘要</td>
                        <td>作者</td>
                        <td>创建时间</td>
                        <td>操作</td>
                    </tr>
                    <c:forEach var="news" items="${sessionScope.list}">
                        <tr>
                            <td>${news.id}</td>
                            <td>${news.title}</td>
                            <td>${news.summary}</td>
                            <td>${news.author}</td>
                            <td>${news.createdate}</td>
                            <td><a href="/News/showPinLun?id=${news.id}">查看评论</a>||<a href="/News/addPinLun?id=${news.id}">评论</a>||<a οnclick="return confirm('确认删除该评论吗?')" href="/News/del?id=${news.id}">删除</a></td>
                        </tr>
                    </c:forEach>
                </table>
            </div>
            <div align="center" style="margin-top: 30px">
                <table cellspacing="1" cellpadding="10">
                    <tr>
                        <td><a href="javascript:goPage(1)">首页</a></td>
                        <td><a href="javascript:goPage(${sessionScope.page.currPage-1})">上一页</a></td>
                        <td><c:forEach var="i" begin="1" end="${sessionScope.page.totalPage}"> <a href="javascript:goPage(${i})">${i}</a></c:forEach>
                        </td>
                        <td><a href="javascript:goPage(${sessionScope.page.currPage+1})">下一页</a></td>
                        <td><a href="javascript:goPage(${sessionScope.page.totalPage})">尾页</a></td>
                        <td>
                            跳转到
                            <input type="text" value="${sessionScope.page.currPage}" size="5">页
                            <input type="button" value="跳转" οnclick="goPage(this.previousElementSibling.value)">
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    
    </body>
    <script>
        function goPage(v) {
            if(v<1){
                v=1;
            }
            var totalPage=${sessionScope.page.totalPage}
            if(v>totalPage){
                v=totalPage;
            }
            if(totalPage=0){
                v=1;
            }
            $(":hidden").val(v);
            $("form").submit();
        }
    </script>
    </html>
    
    

    web/jsp/showPinLun.jsp

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%--
      Created by IntelliJ IDEA.
      User: Administrator
      Date: 2019/6/10
      Time: 12:15
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>新闻管理系统</title>
    </head>
    <body>
    <hr color="bisque">
    <div>
        <div style="background-color: ghostwhite">
            <div style="width: 50px;float: left;margin: 15px auto auto 60px"><span style="font-family: kaiti;font-size: 25px;color: darkorchid">旧波新闻</span></div>
            [外链图片转存失败(img-lxVzRoGT-1562068507987)(https://mp.csdn.net/img/bgimg2.jpg)]
            <span style="color: blue;font-family: kaiti;font-size: 50px;margin-left: 140px">欢迎访问旧波新闻!</span>
            <div style="float: right;margin-right: 100px">
                <ul style="list-style-type: none">
                    <li style="display:inline-block"><a href="/News/" style="color: black">首页/</a></li>
                    <li style="display:inline-block"><a href="/News/jsp/login.jsp" style="color: black">登录/</a></li>
                    <li style="display:inline-block"><a href="/News/jsp/register.jsp" style="color: black">注册</a></li>
                </ul>
            </div>
        </div>
    
        <h4 ><hr color="bisque"></h4>
        <div align="center">
            <h3>评论列表</h3>
            <input type="button" value="返回新闻列表页面" οnclick="location.href='/News/show'">
        </div>
        <div align="center">
            <table border="1" cellspacing="1" cellpadding="10">
                <tr>
                    <td>评论编号</td>
                    <td>评论内容</td>
                    <td>评论人</td>
                    <td>评论时间</td>
                </tr>
                <c:forEach var="pinglun" items="${sessionScope.list}">
                    <tr>
                        <td>${pinglun.id}</td>
                        <td>${pinglun.content}</td>
                        <td>${pinglun.author}</td>
                        <td>${pinglun.createdate}</td>
                    </tr>
                </c:forEach>
            </table>
        </div>
    </div>
    
    </body>
    </html>
    
    

    web/WEB-INF/web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
    	    targetNamespace="http://java.sun.com/xml/ns/javaee"
    	    xmlns:javaee="http://java.sun.com/xml/ns/javaee"
    	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    	    elementFormDefault="qualified"
    	    attributeFormDefault="unqualified"
    	    version="2.5">
      <xsd:annotation>
        <xsd:documentation>
          @(#)web-app_2_5.xsds	1.68 07/03/09
        </xsd:documentation>
      </xsd:annotation>
    
      <xsd:annotation>
        <xsd:documentation>
    
          DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    
          Copyright 2003-2007 Sun Microsystems, Inc. All rights reserved.
    
          The contents of this file are subject to the terms of either the
          GNU General Public License Version 2 only ("GPL") or the Common
          Development and Distribution License("CDDL") (collectively, the
          "License").  You may not use this file except in compliance with
          the License. You can obtain a copy of the License at
          https://glassfish.dev.java.net/public/CDDL+GPL.html or
          glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
          specific language governing permissions and limitations under the
          License.
    
          When distributing the software, include this License Header
          Notice in each file and include the License file at
          glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
          particular file as subject to the "Classpath" exception as
          provided by Sun in the GPL Version 2 section of the License file
          that accompanied this code.  If applicable, add the following
          below the License Header, with the fields enclosed by brackets []
          replaced by your own identifying information:
          "Portions Copyrighted [year] [name of copyright owner]"
    
          Contributor(s):
    
          If you wish your version of this file to be governed by only the
          CDDL or only the GPL Version 2, indicate your decision by adding
          "[Contributor] elects to include this software in this
          distribution under the [CDDL or GPL Version 2] license."  If you
          don't indicate a single choice of license, a recipient has the
          option to distribute your version of this file under either the
          CDDL, the GPL Version 2 or to extend the choice of license to its
          licensees as provided above.  However, if you add GPL Version 2
          code and therefore, elected the GPL Version 2 license, then the
          option applies only if the new code is made subject to such
          option by the copyright holder.
    
        </xsd:documentation>
      </xsd:annotation>
    
      <xsd:annotation>
        <xsd:documentation>
          <![CDATA[
    
    	This is the XML Schema for the Servlet 2.5 deployment descriptor.
    	The deployment descriptor must be named "WEB-INF/web.xml" in the
    	web application's war file.  All Servlet deployment descriptors
    	must indicate the web application schema by using the Java EE
    	namespace:
    
    	http://java.sun.com/xml/ns/javaee
    
    	and by indicating the version of the schema by
    	using the version element as shown below:
    
    	    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
    	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	      xsi:schemaLocation="..."
    	      version="2.5">
    	      ...
    	    </web-app>
    
    	The instance documents may indicate the published version of
    	the schema using the xsi:schemaLocation attribute for Java EE
    	namespace with the following location:
    
    	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
    
    	]]>
        </xsd:documentation>
      </xsd:annotation>
    
      <xsd:annotation>
        <xsd:documentation>
    
          The following conventions apply to all Java EE
          deployment descriptor elements unless indicated otherwise.
    
          - In elements that specify a pathname to a file within the
    	same JAR file, relative filenames (i.e., those not
    	starting with "/") are considered relative to the root of
    	the JAR file's namespace.  Absolute filenames (i.e., those
    	starting with "/") also specify names in the root of the
    	JAR file's namespace.  In general, relative names are
    	preferred.  The exception is .war files where absolute
    	names are preferred for consistency with the Servlet API.
    
        </xsd:documentation>
      </xsd:annotation>
    
      <xsd:include schemaLocation="javaee_5.xsd"/>
      <xsd:include schemaLocation="jsp_2_1.xsd"/>
    
    
    <!-- **************************************************** -->
    
      <xsd:element name="web-app" type="javaee:web-appType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The web-app element is the root of the deployment
    	descriptor for a web application.  Note that the sub-elements
    	of this element can be in the arbitrary order. Because of
    	that, the multiplicity of the elements of distributable,
    	session-config, welcome-file-list, jsp-config, login-config,
    	and locale-encoding-mapping-list was changed from "?" to "*"
    	in this schema.  However, the deployment descriptor instance
    	file must not contain multiple elements of session-config,
    	jsp-config, and login-config. When there are multiple elements of
    	welcome-file-list or locale-encoding-mapping-list, the container
    	must concatenate the element contents.  The multiple occurence
    	of the element distributable is redundant and the container
    	treats that case exactly in the same way when there is only
    	one distributable.
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:unique name="web-app-servlet-name-uniqueness">
          <xsd:annotation>
    	<xsd:documentation>
    
    	  The servlet element contains the name of a servlet.
    	  The name must be unique within the web application.
    
    	</xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:servlet"/>
          <xsd:field    xpath="javaee:servlet-name"/>
        </xsd:unique>
    
        <xsd:unique name="web-app-filter-name-uniqueness">
          <xsd:annotation>
    	<xsd:documentation>
    
    	  The filter element contains the name of a filter.
    	  The name must be unique within the web application.
    
    	</xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:filter"/>
          <xsd:field    xpath="javaee:filter-name"/>
        </xsd:unique>
    
        <xsd:unique name="web-app-ejb-local-ref-name-uniqueness">
          <xsd:annotation>
    	<xsd:documentation>
    
    	  The ejb-local-ref-name element contains the name of an EJB
    	  reference. The EJB reference is an entry in the web
    	  application's environment and is relative to the
    	  java:comp/env context.  The name must be unique within
    	  the web application.
    
    	  It is recommended that name is prefixed with "ejb/".
    
    	</xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:ejb-local-ref"/>
          <xsd:field    xpath="javaee:ejb-ref-name"/>
        </xsd:unique>
    
        <xsd:unique name="web-app-ejb-ref-name-uniqueness">
          <xsd:annotation>
    	<xsd:documentation>
    
    	  The ejb-ref-name element contains the name of an EJB
    	  reference. The EJB reference is an entry in the web
    	  application's environment and is relative to the
    	  java:comp/env context.  The name must be unique within
    	  the web application.
    
    	  It is recommended that name is prefixed with "ejb/".
    
    	</xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:ejb-ref"/>
          <xsd:field    xpath="javaee:ejb-ref-name"/>
        </xsd:unique>
    
        <xsd:unique name="web-app-resource-env-ref-uniqueness">
          <xsd:annotation>
    	<xsd:documentation>
    
    	  The resource-env-ref-name element specifies the name of
    	  a resource environment reference; its value is the
    	  environment entry name used in the web application code.
    	  The name is a JNDI name relative to the java:comp/env
    	  context and must be unique within a web application.
    
    	</xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:resource-env-ref"/>
          <xsd:field    xpath="javaee:resource-env-ref-name"/>
        </xsd:unique>
    
        <xsd:unique name="web-app-message-destination-ref-uniqueness">
          <xsd:annotation>
    	<xsd:documentation>
    
    	  The message-destination-ref-name element specifies the name of
    	  a message destination reference; its value is the
    	  environment entry name used in the web application code.
    	  The name is a JNDI name relative to the java:comp/env
    	  context and must be unique within a web application.
    
    	</xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:message-destination-ref"/>
          <xsd:field    xpath="javaee:message-destination-ref-name"/>
        </xsd:unique>
    
        <xsd:unique name="web-app-res-ref-name-uniqueness">
          <xsd:annotation>
    	<xsd:documentation>
    
    	  The res-ref-name element specifies the name of a
    	  resource manager connection factory reference.  The name
    	  is a JNDI name relative to the java:comp/env context.
    	  The name must be unique within a web application.
    
    	</xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:resource-ref"/>
          <xsd:field    xpath="javaee:res-ref-name"/>
        </xsd:unique>
    
        <xsd:unique name="web-app-env-entry-name-uniqueness">
          <xsd:annotation>
    	<xsd:documentation>
    
    	  The env-entry-name element contains the name of a web
    	  application's environment entry.  The name is a JNDI
    	  name relative to the java:comp/env context.  The name
    	  must be unique within a web application.
    
    	</xsd:documentation>
          </xsd:annotation>
    
          <xsd:selector xpath="javaee:env-entry"/>
          <xsd:field    xpath="javaee:env-entry-name"/>
        </xsd:unique>
    
        <xsd:key name="web-app-role-name-key">
          <xsd:annotation>
    	<xsd:documentation>
    
    	  A role-name-key is specified to allow the references
    	  from the security-role-refs.
    
    	</xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:security-role"/>
          <xsd:field    xpath="javaee:role-name"/>
        </xsd:key>
    
        <xsd:keyref name="web-app-role-name-references"
    		refer="javaee:web-app-role-name-key">
          <xsd:annotation>
    	<xsd:documentation>
    
    	  The keyref indicates the references from
    	  security-role-ref to a specified role-name.
    
    	</xsd:documentation>
          </xsd:annotation>
          <xsd:selector xpath="javaee:servlet/javaee:security-role-ref"/>
          <xsd:field    xpath="javaee:role-link"/>
        </xsd:keyref>
      </xsd:element>
    
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="auth-constraintType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The auth-constraintType indicates the user roles that
    	should be permitted access to this resource
    	collection. The role-name used here must either correspond
    	to the role-name of one of the security-role elements
    	defined for this web application, or be the specially
    	reserved role-name "*" that is a compact syntax for
    	indicating all roles in the web application. If both "*"
    	and rolenames appear, the container interprets this as all
    	roles.  If no roles are defined, no user is allowed access
    	to the portion of the web application described by the
    	containing security-constraint.  The container matches
    	role names case sensitively when determining access.
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:element name="description"
    		   type="javaee:descriptionType"
    		   minOccurs="0" maxOccurs="unbounded"/>
          <xsd:element name="role-name"
    		   type="javaee:role-nameType"
    		   minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="auth-methodType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The auth-methodType is used to configure the authentication
    	mechanism for the web application. As a prerequisite to
    	gaining access to any web resources which are protected by
    	an authorization constraint, a user must have authenticated
    	using the configured mechanism. Legal values are "BASIC",
    	"DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific
    	authentication scheme.
    
    	Used in: login-config
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:simpleContent>
          <xsd:restriction base="javaee:string"/>
        </xsd:simpleContent>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="dispatcherType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The dispatcher has four legal values: FORWARD, REQUEST, INCLUDE,
    	and ERROR. A value of FORWARD means the Filter will be applied
    	under RequestDispatcher.forward() calls.  A value of REQUEST
    	means the Filter will be applied under ordinary client calls to
    	the path or servlet. A value of INCLUDE means the Filter will be
    	applied under RequestDispatcher.include() calls.  A value of
    	ERROR means the Filter will be applied under the error page
    	mechanism.  The absence of any dispatcher elements in a
    	filter-mapping indicates a default of applying filters only under
    	ordinary client calls to the path or servlet.
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:simpleContent>
          <xsd:restriction base="javaee:string">
    	<xsd:enumeration value="FORWARD"/>
    	<xsd:enumeration value="INCLUDE"/>
    	<xsd:enumeration value="REQUEST"/>
    	<xsd:enumeration value="ERROR"/>
          </xsd:restriction>
        </xsd:simpleContent>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:simpleType name="encodingType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The encodingType defines IANA character sets.
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:restriction base="xsd:string">
          <xsd:pattern value="[^\s]+"/>
        </xsd:restriction>
      </xsd:simpleType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="error-codeType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The error-code contains an HTTP error code, ex: 404
    
    	Used in: error-page
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:simpleContent>
          <xsd:restriction base="javaee:xsdPositiveIntegerType">
    	<xsd:pattern value="\d{3}"/>
    	<xsd:attribute name="id" type="xsd:ID"/>
          </xsd:restriction>
        </xsd:simpleContent>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="error-pageType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The error-pageType contains a mapping between an error code
    	or exception type to the path of a resource in the web
    	application.
    
    	Used in: web-app
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:choice>
    	<xsd:element name="error-code"
    		     type="javaee:error-codeType"/>
    
    	<xsd:element name="exception-type"
    		     type="javaee:fully-qualified-classType">
    	  <xsd:annotation>
    	    <xsd:documentation>
    
    	      The exception-type contains a fully qualified class
    	      name of a Java exception type.
    
    	    </xsd:documentation>
    	  </xsd:annotation>
    	</xsd:element>
          </xsd:choice>
    
          <xsd:element name="location"
    		   type="javaee:war-pathType">
    	<xsd:annotation>
    	  <xsd:documentation>
    
    	    The location element contains the location of the
    	    resource in the web application relative to the root of
    	    the web application. The value of the location must have
    	    a leading `/'.
    
    	  </xsd:documentation>
    	</xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="filter-mappingType">
        <xsd:annotation>
          <xsd:documentation>
    
    	Declaration of the filter mappings in this web
    	application is done by using filter-mappingType.
    	The container uses the filter-mapping
    	declarations to decide which filters to apply to a request,
    	and in what order. The container matches the request URI to
    	a Servlet in the normal way. To determine which filters to
    	apply it matches filter-mapping declarations either on
    	servlet-name, or on url-pattern for each filter-mapping
    	element, depending on which style is used. The order in
    	which filters are invoked is the order in which
    	filter-mapping declarations that match a request URI for a
    	servlet appear in the list of filter-mapping elements.The
    	filter-name value must be the value of the filter-name
    	sub-elements of one of the filter declarations in the
    	deployment descriptor.
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:element name="filter-name"
    		   type="javaee:filter-nameType"/>
          <xsd:choice minOccurs="1" maxOccurs="unbounded">
    	<xsd:element name="url-pattern"
    		     type="javaee:url-patternType"/>
    	<xsd:element name="servlet-name"
    		     type="javaee:servlet-nameType"/>
          </xsd:choice>
          <xsd:element name="dispatcher"
    		   type="javaee:dispatcherType"
    		   minOccurs="0" maxOccurs="4"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="filter-nameType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The logical name of the filter is declare
    	by using filter-nameType. This name is used to map the
    	filter.  Each filter name is unique within the web
    	application.
    
    	Used in: filter, filter-mapping
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:simpleContent>
          <xsd:extension base="javaee:nonEmptyStringType"/>
        </xsd:simpleContent>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="filterType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The filterType is used to declare a filter in the web
    	application. The filter is mapped to either a servlet or a
    	URL pattern in the filter-mapping element, using the
    	filter-name value to reference. Filters can access the
    	initialization parameters declared in the deployment
    	descriptor at runtime via the FilterConfig interface.
    
    	Used in: web-app
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:group ref="javaee:descriptionGroup"/>
          <xsd:element name="filter-name"
    		   type="javaee:filter-nameType"/>
          <xsd:element name="filter-class"
    		   type="javaee:fully-qualified-classType">
    	<xsd:annotation>
    	  <xsd:documentation>
    
    	    The fully qualified classname of the filter.
    
    	  </xsd:documentation>
    	</xsd:annotation>
          </xsd:element>
    
          <xsd:element name="init-param"
    		   type="javaee:param-valueType"
    		   minOccurs="0" maxOccurs="unbounded">
    	<xsd:annotation>
    	  <xsd:documentation>
    
    	    The init-param element contains a name/value pair as
    	    an initialization param of a servlet filter
    
    	  </xsd:documentation>
    	</xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="form-login-configType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The form-login-configType specifies the login and error
    	pages that should be used in form based login. If form based
    	authentication is not used, these elements are ignored.
    
    	Used in: login-config
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
    
          <xsd:element name="form-login-page"
    		   type="javaee:war-pathType">
    	<xsd:annotation>
    	  <xsd:documentation>
    
    	    The form-login-page element defines the location in the web
    	    app where the page that can be used for login can be
    	    found.  The path begins with a leading / and is interpreted
    	    relative to the root of the WAR.
    
    	  </xsd:documentation>
    	</xsd:annotation>
          </xsd:element>
    
          <xsd:element name="form-error-page"
    		   type="javaee:war-pathType">
    	<xsd:annotation>
    	  <xsd:documentation>
    
    	    The form-error-page element defines the location in
    	    the web app where the error page that is displayed
    	    when login is not successful can be found.
    	    The path begins with a leading / and is interpreted
    	    relative to the root of the WAR.
    
    	  </xsd:documentation>
    	</xsd:annotation>
          </xsd:element>
    
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:simpleType name="http-methodType">
        <xsd:annotation>
    
          <xsd:documentation>
    
    	A HTTP method type as defined in HTTP 1.1 section 2.2.
    
          </xsd:documentation>
        </xsd:annotation>
    
         <xsd:restriction base="xsd:token">
          <xsd:pattern value="[&#33;-&#126;-[\(\)&#60;&#62;@,;:&#34;/\[\]?=\{\}\\\p{Z}]]+"/>
         </xsd:restriction>
    
      </xsd:simpleType>
    
    <!-- **************************************************** -->
    
      <xsd:simpleType name="load-on-startupType">
        <xsd:union memberTypes="javaee:null-charType xsd:integer"/>
      </xsd:simpleType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="locale-encoding-mapping-listType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The locale-encoding-mapping-list contains one or more
    	locale-encoding-mapping(s).
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:element name="locale-encoding-mapping"
    		   type="javaee:locale-encoding-mappingType"
    		   maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="locale-encoding-mappingType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The locale-encoding-mapping contains locale name and
    	encoding name. The locale name must be either "Language-code",
    	such as "ja", defined by ISO-639 or "Language-code_Country-code",
    	such as "ja_JP".  "Country code" is defined by ISO-3166.
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:element name="locale"
    		   type="javaee:localeType"/>
          <xsd:element name="encoding"
    		   type="javaee:encodingType"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:simpleType name="localeType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The localeType defines valid locale defined by ISO-639-1
    	and ISO-3166.
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:restriction base="xsd:string">
          <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
        </xsd:restriction>
      </xsd:simpleType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="login-configType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The login-configType is used to configure the authentication
    	method that should be used, the realm name that should be
    	used for this application, and the attributes that are
    	needed by the form login mechanism.
    
    	Used in: web-app
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:element name="auth-method"
    		   type="javaee:auth-methodType"
    		   minOccurs="0"/>
          <xsd:element name="realm-name"
    		   type="javaee:string" minOccurs="0">
    	<xsd:annotation>
    	  <xsd:documentation>
    
    	    The realm name element specifies the realm name to
    	    use in HTTP Basic authorization.
    
    	  </xsd:documentation>
    	</xsd:annotation>
          </xsd:element>
          <xsd:element name="form-login-config"
    		   type="javaee:form-login-configType"
    		   minOccurs="0"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="mime-mappingType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The mime-mappingType defines a mapping between an extension
    	and a mime type.
    
    	Used in: web-app
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:annotation>
    	<xsd:documentation>
    
    	  The extension element contains a string describing an
    	  extension. example: "txt"
    
    	</xsd:documentation>
          </xsd:annotation>
    
          <xsd:element name="extension"
    		   type="javaee:string"/>
          <xsd:element name="mime-type"
    		   type="javaee:mime-typeType"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="mime-typeType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The mime-typeType is used to indicate a defined mime type.
    
    	Example:
    	"text/plain"
    
    	Used in: mime-mapping
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:simpleContent>
          <xsd:restriction base="javaee:string">
    	<xsd:pattern value="[^\p{Cc}^\s]+/[^\p{Cc}^\s]+"/>
          </xsd:restriction>
        </xsd:simpleContent>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="nonEmptyStringType">
        <xsd:annotation>
          <xsd:documentation>
    	This type defines a string which contains at least one
    	character.
          </xsd:documentation>
        </xsd:annotation>
        <xsd:simpleContent>
          <xsd:restriction base="javaee:string">
    	<xsd:minLength value="1"/>
          </xsd:restriction>
        </xsd:simpleContent>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:simpleType name="null-charType">
        <xsd:restriction base="xsd:string">
          <xsd:enumeration value=""/>
        </xsd:restriction>
      </xsd:simpleType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="security-constraintType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The security-constraintType is used to associate
    	security constraints with one or more web resource
    	collections
    
    	Used in: web-app
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:element name="display-name"
    		   type="javaee:display-nameType"
    		   minOccurs="0"
    		   maxOccurs="unbounded"/>
          <xsd:element name="web-resource-collection"
    		   type="javaee:web-resource-collectionType"
    		   maxOccurs="unbounded"/>
          <xsd:element name="auth-constraint"
    		   type="javaee:auth-constraintType"
    		   minOccurs="0"/>
          <xsd:element name="user-data-constraint"
    		   type="javaee:user-data-constraintType"
    		   minOccurs="0"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="servlet-mappingType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The servlet-mappingType defines a mapping between a
    	servlet and a url pattern.
    
    	Used in: web-app
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:element name="servlet-name"
    		   type="javaee:servlet-nameType"/>
          <xsd:element name="url-pattern"
    		   type="javaee:url-patternType"
               minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="servlet-nameType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The servlet-name element contains the canonical name of the
    	servlet. Each servlet name is unique within the web
    	application.
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:simpleContent>
          <xsd:extension base="javaee:nonEmptyStringType"/>
        </xsd:simpleContent>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="servletType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The servletType is used to declare a servlet.
    	It contains the declarative data of a
    	servlet. If a jsp-file is specified and the load-on-startup
    	element is present, then the JSP should be precompiled and
    	loaded.
    
    	Used in: web-app
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:group ref="javaee:descriptionGroup"/>
          <xsd:element name="servlet-name"
    		   type="javaee:servlet-nameType"/>
          <xsd:choice>
    	<xsd:element name="servlet-class"
    		     type="javaee:fully-qualified-classType">
    	  <xsd:annotation>
    	    <xsd:documentation>
    
    	      The servlet-class element contains the fully
    	      qualified class name of the servlet.
    
    	    </xsd:documentation>
    	  </xsd:annotation>
    	</xsd:element>
    
    	<xsd:element name="jsp-file"
    		     type="javaee:jsp-fileType"/>
    
          </xsd:choice>
    
          <xsd:element name="init-param"
    		   type="javaee:param-valueType"
    		   minOccurs="0" maxOccurs="unbounded"/>
          <xsd:element name="load-on-startup"
    		   type="javaee:load-on-startupType"
    		   minOccurs="0">
    	<xsd:annotation>
    	  <xsd:documentation>
    
    	    The load-on-startup element indicates that this
    	    servlet should be loaded (instantiated and have
    	    its init() called) on the startup of the web
    	    application. The optional contents of these
    	    element must be an integer indicating the order in
    	    which the servlet should be loaded. If the value
    	    is a negative integer, or the element is not
    	    present, the container is free to load the servlet
    	    whenever it chooses. If the value is a positive
    	    integer or 0, the container must load and
    	    initialize the servlet as the application is
    	    deployed. The container must guarantee that
    	    servlets marked with lower integers are loaded
    	    before servlets marked with higher integers. The
    	    container may choose the order of loading of
    	    servlets with the same load-on-start-up value.
    
    	  </xsd:documentation>
    	</xsd:annotation>
          </xsd:element>
          <xsd:element name="run-as"
    		   type="javaee:run-asType"
    		   minOccurs="0"/>
          <xsd:element name="security-role-ref"
    		   type="javaee:security-role-refType"
    		   minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="session-configType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The session-configType defines the session parameters
    	for this web application.
    
    	Used in: web-app
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:element name="session-timeout"
    		   type="javaee:xsdIntegerType"
    		   minOccurs="0">
    	<xsd:annotation>
    	  <xsd:documentation>
    
    	    The session-timeout element defines the default
    	    session timeout interval for all sessions created
    	    in this web application. The specified timeout
    	    must be expressed in a whole number of minutes.
    	    If the timeout is 0 or less, the container ensures
    	    the default behaviour of sessions is never to time
    	    out. If this element is not specified, the container
    	    must set its default timeout period.
    
    	  </xsd:documentation>
    	</xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="transport-guaranteeType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The transport-guaranteeType specifies that the communication
    	between client and server should be NONE, INTEGRAL, or
    	CONFIDENTIAL. NONE means that the application does not
    	require any transport guarantees. A value of INTEGRAL means
    	that the application requires that the data sent between the
    	client and server be sent in such a way that it can't be
    	changed in transit. CONFIDENTIAL means that the application
    	requires that the data be transmitted in a fashion that
    	prevents other entities from observing the contents of the
    	transmission. In most cases, the presence of the INTEGRAL or
    	CONFIDENTIAL flag will indicate that the use of SSL is
    	required.
    
    	Used in: user-data-constraint
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:simpleContent>
          <xsd:restriction base="javaee:string">
    	<xsd:enumeration value="NONE"/>
    	<xsd:enumeration value="INTEGRAL"/>
    	<xsd:enumeration value="CONFIDENTIAL"/>
          </xsd:restriction>
        </xsd:simpleContent>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="user-data-constraintType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The user-data-constraintType is used to indicate how
    	data communicated between the client and container should be
    	protected.
    
    	Used in: security-constraint
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:element name="description"
    		   type="javaee:descriptionType"
    		   minOccurs="0"
    		   maxOccurs="unbounded"/>
          <xsd:element name="transport-guarantee"
    		   type="javaee:transport-guaranteeType"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="war-pathType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The elements that use this type designate a path starting
    	with a "/" and interpreted relative to the root of a WAR
    	file.
    
          </xsd:documentation>
        </xsd:annotation>
        <xsd:simpleContent>
          <xsd:restriction base="javaee:string">
    	<xsd:pattern value="/.*"/>
          </xsd:restriction>
        </xsd:simpleContent>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:simpleType name="web-app-versionType">
        <xsd:annotation>
          <xsd:documentation>
    
    	This type contains the recognized versions of
    	web-application supported. It is used to designate the
    	version of the web application.
    
          </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:token">
          <xsd:enumeration value="2.5"/>
        </xsd:restriction>
      </xsd:simpleType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="web-appType">
    
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
          <xsd:group ref="javaee:descriptionGroup"/>
          <xsd:element name="distributable"
    		   type="javaee:emptyType"/>
          <xsd:element name="context-param"
    		   type="javaee:param-valueType">
    
    	<xsd:annotation>
    	  <xsd:documentation>
    
    	    The context-param element contains the declaration
    	    of a web application's servlet context
    	    initialization parameters.
    
    	  </xsd:documentation>
    	</xsd:annotation>
          </xsd:element>
    
          <xsd:element name="filter"
    		   type="javaee:filterType"/>
          <xsd:element name="filter-mapping"
    		   type="javaee:filter-mappingType"/>
          <xsd:element name="listener"
    		   type="javaee:listenerType"/>
          <xsd:element name="servlet"
    		   type="javaee:servletType"/>
          <xsd:element name="servlet-mapping"
    		   type="javaee:servlet-mappingType"/>
          <xsd:element name="session-config"
    		   type="javaee:session-configType"/>
          <xsd:element name="mime-mapping"
    		   type="javaee:mime-mappingType"/>
          <xsd:element name="welcome-file-list"
    		   type="javaee:welcome-file-listType"/>
          <xsd:element name="error-page"
    		   type="javaee:error-pageType"/>
          <xsd:element name="jsp-config"
    		   type="javaee:jsp-configType"/>
          <xsd:element name="security-constraint"
    		   type="javaee:security-constraintType"/>
          <xsd:element name="login-config"
    		   type="javaee:login-configType"/>
          <xsd:element name="security-role"
    		   type="javaee:security-roleType"/>
          <xsd:group ref="javaee:jndiEnvironmentRefsGroup"/>
          <xsd:element name="message-destination"
    		   type="javaee:message-destinationType"/>
          <xsd:element name="locale-encoding-mapping-list"
    		   type="javaee:locale-encoding-mapping-listType"/>
        </xsd:choice>
    
        <xsd:attribute name="version"
    		   type="javaee:web-app-versionType"
    		   use="required"/>
        <xsd:attribute name="id" type="xsd:ID"/>
    
        <xsd:attribute name="metadata-complete" type="xsd:boolean">
          <xsd:annotation>
    	<xsd:documentation>
    
    	  The metadata-complete attribute defines whether this
    	  deployment descriptor and other related deployment
    	  descriptors for this module (e.g., web service
    	  descriptors) are complete, or whether the class
    	  files available to this module and packaged with
    	  this application should be examined for annotations
    	  that specify deployment information.
    
    	  If metadata-complete is set to "true", the deployment
    	  tool must ignore any annotations that specify deployment
    	  information, which might be present in the class files
    	  of the application.
    
    	  If metadata-complete is not specified or is set to
    	  "false", the deployment tool must examine the class
    	  files of the application for annotations, as
    	  specified by the specifications.
    
    	</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
    
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="web-resource-collectionType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The web-resource-collectionType is used to identify a subset
    	of the resources and HTTP methods on those resources within
    	a web application to which a security constraint applies. If
    	no HTTP methods are specified, then the security constraint
    	applies to all HTTP methods.
    
    	Used in: security-constraint
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:element name="web-resource-name"
    		   type="javaee:string">
    	<xsd:annotation>
    	  <xsd:documentation>
    
    	    The web-resource-name contains the name of this web
    	    resource collection.
    
    	  </xsd:documentation>
    	</xsd:annotation>
          </xsd:element>
          <xsd:element name="description"
    		   type="javaee:descriptionType"
    		   minOccurs="0"
    		   maxOccurs="unbounded"/>
          <xsd:element name="url-pattern"
    		   type="javaee:url-patternType"
    		   maxOccurs="unbounded"/>
          <xsd:element name="http-method"
    		   type="javaee:http-methodType"
    		   minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    <!-- **************************************************** -->
    
      <xsd:complexType name="welcome-file-listType">
        <xsd:annotation>
          <xsd:documentation>
    
    	The welcome-file-list contains an ordered list of welcome
    	files elements.
    
    	Used in: web-app
    
          </xsd:documentation>
        </xsd:annotation>
    
        <xsd:sequence>
          <xsd:element name="welcome-file"
    		   type="xsd:string"
    		   maxOccurs="unbounded">
    	<xsd:annotation>
    	  <xsd:documentation>
    
    	    The welcome-file element contains file name to use
    	    as a default welcome file, such as index.html
    
    	  </xsd:documentation>
    	</xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:complexType>
    
    </xsd:schema>
    
    

    web/index.jsp

    <%--
      Created by IntelliJ IDEA.
      User: Administrator
      Date: 2019/6/6
      Time: 13:59
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
      <head>
        <title>新闻管理系统</title>
      </head>
      <body bgcolor="#dcdcdc">
      <hr color="bisque">
     <div>
       <div style="background-color: ghostwhite">
           <div style="width: 50px;float: left;margin: 15px auto auto 60px"><span style="font-family: kaiti;font-size: 25px;color: darkorchid">旧波新闻</span></div>
         [外链图片转存失败(img-CXJ815R7-1562068507989)(https://mp.csdn.net/img/bgimg2.jpg)]
           <span style="color: blue;font-family: kaiti;font-size: 50px;margin-left: 140px">欢迎访问旧波新闻!</span>
           <div style="float: right;margin-right: 100px">
               <ul style="list-style-type: none">
                   <li style="display:inline-block"><a href="/News/" style="color: black">首页/</a></li>
                   <li style="display:inline-block"><a href="/News/jsp/login.jsp" style="color: black">登录/</a></li>
                   <li style="display:inline-block"><a href="/News/jsp/register.jsp" style="color: black">注册</a></li>
               </ul>
           </div>
       </div>
       <h4 ><hr color="bisque"></h4>
         <div align="center">
            <table cellspacing="1" cellpadding="15">
                <tr>
                    <td>[外链图片转存失败(img-2nBd95HK-1562068507991)(https://mp.csdn.net/img/-1_11.gif)]<a href="" style="color: black">新闻头条</a></td>
                    <td>[外链图片转存失败(img-Li1KxHj3-1562068507992)(https://mp.csdn.net/img/-1_11.gif)]<a href="" style="color: black">电视剧</a></td>
                    <td>[外链图片转存失败(img-nmYNgRWR-1562068507993)(https://mp.csdn.net/img/-1_11.gif)]<a href="" style="color: black">免费小说</a></td>
                    <td>[外链图片转存失败(img-INN8rV4f-1562068507994)(https://mp.csdn.net/img/-1_11.gif)]<a href="" style="color: black">热播电影</a></td>
                    <td>[外链图片转存失败(img-HUga0NuQ-1562068507995)(https://mp.csdn.net/img/-1_11.gif)]<a href="" style="color: black">9块9包邮</a></td>
                    <td>[外链图片转存失败(img-jzVCuMRw-1562068507996)(https://mp.csdn.net/img/-1_11.gif)]<a href="" style="color: black">彩票大全</a></td>
                    <td>[外链图片转存失败(img-vFoFw42D-1562068507997)(https://mp.csdn.net/img/-1_11.gif)]<a href="" style="color: black">游戏</a></td>
                    <td>[外链图片转存失败(img-qAhdBXyb-1562068507999)(https://mp.csdn.net/img/-1_11.gif)]<a href="" style="color: black">网上购物</a></td>
                    <td>[外链图片转存失败(img-DByefdGU-1562068507999)(https://mp.csdn.net/img/-1_11.gif)]<a href="" style="color: black">特价旅游</a></td>
                    <td>[外链图片转存失败(img-YkTG4XoT-1562068507999)(https://mp.csdn.net/img/-1_11.gif)]<a href="" style="color: black">小游戏大全</a></td>
                    <td>[外链图片转存失败(img-M2Mc4oL5-1562068508000)(https://mp.csdn.net/img/-1_11.gif)]<a href="" style="color: black">精彩直播</a></td>
                </tr>
            </table>
         </div>
         <div style="background-color: white" align="center">
             <table cellpadding="40" cellspacing="1">
                 <tr>
                     <td><a href="" style="color: black">搜狐新闻</a></td>
                     <td><a href="" style="color: black">腾讯视频</a></td>
                     <td><a href="" style="color: black">天猫618</a></td>
                     <td><a href="" style="color: black">新浪·微博</a></td>
                     <td><a href="" style="color: black">百度·贴吧</a></td>
                     <td><a href="" style="color: black">凤凰·军事</a></td>
                 </tr>
                 <tr>
                     <td><a href="" style="color: black">搜狐新闻</a></td>
                     <td><a href="" style="color: black">腾讯视频</a></td>
                     <td><a href="" style="color: black">天猫618</a></td>
                     <td><a href="" style="color: black">新浪·微博</a></td>
                     <td><a href="" style="color: black">百度·贴吧</a></td>
                     <td><a href="" style="color: black">凤凰·军事</a></td>
                 </tr>
                 <tr>
                     <td><a href="" style="color: black">搜狐新闻</a></td>
                     <td><a href="" style="color: black">腾讯视频</a></td>
                     <td><a href="" style="color: black">天猫618</a></td>
                     <td><a href="" style="color: black">新浪·微博</a></td>
                     <td><a href="" style="color: black">百度·贴吧</a></td>
                     <td><a href="" style="color: black">凤凰·军事</a></td>
                 </tr>
             </table>
         </div>
         <div style="background-color: ghostwhite;width: 1330px;height: 100px;margin-top: 30px">
         <div align="center" style="background-color: ghostwhite;float: left;margin-left: 60px">
             <h4>地址</h4>
             <ul>
                 <li>武汉市洪山区鲁巷广场春和天地</li>
                 <li>北京大学北大青鸟总部</li>
             </ul>
         </div>
             <div align="center" style="background-color: ghostwhite;float: left;margin-left: 200px">
                 <h4>赞助商</h4>
                 <ul>
                     <li>武汉宏鹏培训学校</li>
                     <li>北京大学北大青鸟总部</li>
                 </ul>
             </div>
             <div align="center" style="background-color: ghostwhite;float: right;margin-right: 60px">
                 <h4>联系我</h4>
                 <ul>
                     <li>电话:1871889418</li>
                     <li>QQ:541889418</li>
                 </ul>
             </div>
         </div>
     </div>
      </body>
    </html>
    
    

    三、sql文件

    news_comment

    /*
    SQLyog 企业版 - MySQL GUI v8.14 
    MySQL - 5.5.25 : Database - k9503
    *********************************************************************
    */
    
    
    /*!40101 SET NAMES utf8 */;
    
    /*!40101 SET SQL_MODE=''*/;
    
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    CREATE DATABASE /*!32312 IF NOT EXISTS*/`k9503` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_czech_ci */;
    
    USE `k9503`;
    
    /*Table structure for table `news_comment` */
    
    DROP TABLE IF EXISTS `news_comment`;
    
    CREATE TABLE `news_comment` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `newsid` int(11) NOT NULL,
      `content` varchar(255) COLLATE utf8_czech_ci NOT NULL,
      `author` varchar(50) COLLATE utf8_czech_ci DEFAULT NULL,
      `createdate` date NOT NULL,
      PRIMARY KEY (`id`),
      KEY `FK_news_comment` (`newsid`)
    ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
    
    /*Data for the table `news_comment` */
    
    insert  into `news_comment`(`id`,`newsid`,`content`,`author`,`createdate`) values (2,1,'自由的渴望,超越物种,超越生命','你妈没回家','2019-08-06'),(3,6,'你打球像蔡徐坤','隔壁老王的微笑','2013-05-04'),(4,4,'造孽啊','绿油油的爱','2019-01-09'),(10,4,'厉害厉害','赵四','2019-06-10'),(11,1,'天秀','susan','2019-06-10'),(12,1,'天秀','Susan','2019-06-10'),(13,1,'得到','方法','2012-12-25'),(15,3,'似懂非懂','地方','2019-06-28');
    
    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
    
    

    news_detail

    /*
    SQLyog 企业版 - MySQL GUI v8.14 
    MySQL - 5.5.25 : Database - k9503
    *********************************************************************
    */
    
    
    /*!40101 SET NAMES utf8 */;
    
    /*!40101 SET SQL_MODE=''*/;
    
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    CREATE DATABASE /*!32312 IF NOT EXISTS*/`k9503` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_czech_ci */;
    
    USE `k9503`;
    
    /*Table structure for table `news_detail` */
    
    DROP TABLE IF EXISTS `news_detail`;
    
    CREATE TABLE `news_detail` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `title` varchar(100) COLLATE utf8_czech_ci NOT NULL,
      `summary` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
      `author` varchar(50) COLLATE utf8_czech_ci DEFAULT NULL,
      `createdate` date NOT NULL,
      PRIMARY KEY (`id`,`title`,`createdate`)
    ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
    
    /*Data for the table `news_detail` */
    
    insert  into `news_detail`(`id`,`title`,`summary`,`author`,`createdate`) values (1,'向往自由,母猪跳车','谭山公路,一头母猪飞身跃下货运车','三毛','2019-06-06'),(2,'早点睡了开发积分','分公司kg','带我飞','2017-10-13'),(3,'尼罗河畔惊现水怪','今日,尼罗河畔惊现奇观','鑫乐','2050-04-09'),(4,'高考在即,出租司机无私相送','高考生小李忘带准考证,出租司机秀操作,最终错过高考','李思','1997-06-21'),(5,'的高峰梵蒂冈人','舞蹈服人人为人','地方','1113-04-12'),(6,'练习生蔡徐坤,用努力证明自己是最差的','练习两年半的练习生,每天练习25个小时,最后用自己的努力证明自己是最差的','李元培','2018-08-08');
    
    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
    声明:由于此系统是个人完成的娱乐项目,所以功能不够全面,由于是很早以前的项目,现在只有代码,没有效果图,如有疑问,可在评论出留下自己的疑问,如看到,必定第一时间回复!
    
    
    /*Data for the table `news_comment` */
    
    insert  into `news_comment`(`id`,`newsid`,`content`,`author`,`createdate`) values (2,1,'自由的渴望,超越物种,超越生命','你妈没回家','2019-08-06'),(3,6,'你打球像蔡徐坤','隔壁老王的微笑','2013-05-04'),(4,4,'造孽啊','绿油油的爱','2019-01-09'),(10,4,'厉害厉害','赵四','2019-06-10'),(11,1,'天秀','susan','2019-06-10'),(12,1,'天秀','Susan','2019-06-10'),(13,1,'得到','方法','2012-12-25'),(15,3,'似懂非懂','地方','2019-06-28');
    
    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
    
    

    news_detail

    /*
    SQLyog 企业版 - MySQL GUI v8.14 
    MySQL - 5.5.25 : Database - k9503
    *********************************************************************
    */
    
    
    /*!40101 SET NAMES utf8 */;
    
    /*!40101 SET SQL_MODE=''*/;
    
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    CREATE DATABASE /*!32312 IF NOT EXISTS*/`k9503` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_czech_ci */;
    
    USE `k9503`;
    
    /*Table structure for table `news_detail` */
    
    DROP TABLE IF EXISTS `news_detail`;
    
    CREATE TABLE `news_detail` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `title` varchar(100) COLLATE utf8_czech_ci NOT NULL,
      `summary` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
      `author` varchar(50) COLLATE utf8_czech_ci DEFAULT NULL,
      `createdate` date NOT NULL,
      PRIMARY KEY (`id`,`title`,`createdate`)
    ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
    
    /*Data for the table `news_detail` */
    
    insert  into `news_detail`(`id`,`title`,`summary`,`author`,`createdate`) values (1,'向往自由,母猪跳车','谭山公路,一头母猪飞身跃下货运车','三毛','2019-06-06'),(2,'早点睡了开发积分','分公司kg','带我飞','2017-10-13'),(3,'尼罗河畔惊现水怪','今日,尼罗河畔惊现奇观','鑫乐','2050-04-09'),(4,'高考在即,出租司机无私相送','高考生小李忘带准考证,出租司机秀操作,最终错过高考','李思','1997-06-21'),(5,'的高峰梵蒂冈人','舞蹈服人人为人','地方','1113-04-12'),(6,'练习生蔡徐坤,用努力证明自己是最差的','练习两年半的练习生,每天练习25个小时,最后用自己的努力证明自己是最差的','李元培','2018-08-08');
    
    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
    
    
    

    另外,本人针对大学生提供在线指导,毕业设计的相关疑问均可留言或加微信f2468433277,申请请备注,由于本人处于工作状态,回复可能迟,但看到消息一定会回,有疑问欢迎前来咨询,大家一起探讨,一起成长。
    本系统开发工具为idea,本人对eclipse的使用稍有欠缺,相关疑问无法解答。

    展开全文
  • javaweb开发的简单的新闻管理系统,采用myeclispe10.0,mysql,有基本的新闻发布,增删改查以及用户评论的功能,前端界面写的比较简单,但对初学者肯定有一定帮助的,10分绝对物有所值!欢迎交流,也可以加我 和我...
  • 数据库采用Mysql,所以使用之前需要有Mysql数据库,如果没有mysql架包请导入
  • JavaWeb博客管理系统源码含带毕业设计JavaWeb博客管理系统源码含带毕业设计JavaWeb博客管理系统源码含带毕业设计
  • JAVAWeb新闻发布系统

    千次阅读 2020-05-09 17:12:33
    本网站主要是后台新闻发布和管理,包括:发布新闻,新闻管理,用户管理等; 新闻管理、用户管理,主要是增删改查,新闻管理超级用户对新闻的删除,修改等管理,用户管理也是增删改查。 注册功能:采用的表单提交...

    本网站主要是后台新闻发布和管理,包括:发布新闻,新闻管理,用户管理等;

    新闻管理、用户管理,主要是增删改查,新闻管理超级用户对新闻的删除,修改等管理,用户管理也是增删改查。

    注册功能:采用的表单提交注册,注册验证是用的ajax异步验证,注册成功后,就可以进行登录。

    登录功能:采用session中保存用户名和密码。

    该系统基于jsp、servlet技术,前端使用html、js、bootdtrap等技术,基于MVC模式,数据库使用Mysql,服务器采用Tomcat8,Java环境为JDK8。包含源码,数据库,演示视频,功能讲解(典型的两三个功能讲解)。

    系统演示中文章、分类、名称等均为临时添加,自己购买后都可以自行替换为自己需要的名字,另外在了解系统的基础上,也可以增加修改系统模块。该系统适用于信息发布系统,比如改成娱乐新闻、热点新闻等,自己可以随意修改。

    代码已经上传github,下载地址:https://github.com/21503882/news

     

     

    ROLE_USER:普通用户,ROLE_USER_S:二级用户,ROLE_ADMIN:管理员

    普通用户:只能浏览和改自己的密码

    二级用户:可以发新闻,相当于记者(需要审核)

    管理员:可以增删改查新闻,用户,更改用户权限最高只能改为二级用户

    SpringBoot
    使用SpringSecurity配置来进行权限控制

    @Configuration
    @EnableWebSecurity
    @EnableGlobalMethodSecurity(prePostEnabled=true)

    数据库使用Jpa来操纵

    public interface FileRepository extends JpaRepository<File,Long>{
    }
    前端使用了Bootstrap框架,富文本编辑器使用百度的ueditor,使用模版引擎thymeleaf。

    springboot+ueditor参考了 参考文章

    部分截图:
    新闻首页1 用户信息修改 新闻首页2 后台管理系统 文章管理

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:th="http://www.thymeleaf.org"
          xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
    <title th:text="鸡天新闻-首页"></title>
    <head th:replace="~{fragments/header :: header}" >
    </head>
    <style type="text/css">
        *{
            font-family: 微软雅黑;
        }

    </style>
    <body>
    <div class="container">

        <div class="row">

            <div class="col-md-6">
                <div class="panel panel-warning ">
                    <div class="panel-heading">
                        <h5>国 内 新 闻<span class="badge badge-danger">hot</span></h5>
                    </div>
                    <div class="panel-body">
                        <div class="list-group" th:each="news:${list1}">
                            <a th:href="@{'~/news/detail/'+${news.getnewsId()}}" class="list-group-item">
                                <h6 th:text="${news.getnewsTitle()}"></h6>
                                <p th:text="${news.getnewsWord()}"></p>
                            </a>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="panel panel-danger ">
                    <div class="panel-heading">
                        <h5>国 际 新 闻</h5>
                    </div>
                    <div class="panel-body">
                        <div class="list-group" th:each="news:${list2}">
                            <a th:href="@{'~/news/detail/'+${news.getnewsId()}}" class="list-group-item">
                                <h6 th:text="${news.getnewsTitle()}"></h6>
                                <p th:text="${news.getnewsWord()}"></p>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="panel panel-warning ">
                    <div class="panel-heading">
                        <h5>本 地 新 闻</h5>
                    </div>
                    <div class="panel-body">
                        <div class="list-group" th:each="news:${list3}">
                            <a th:href="@{'~/news/detail/'+${news.getnewsId()}}" class="list-group-item">
                                <h6 th:text="${news.getnewsTitle()}"></h6>
                                <p th:text="${news.getnewsWord()}"></p>
                            </a>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="panel panel-danger ">
                    <div class="panel-heading">
                        <h5>娱 乐 新 闻</h5>
                    </div>
                    <div class="panel-body">
                        <div class="list-group" th:each="news:${list4}">
                            <a th:href="@{'~/news/detail/'+${news.getnewsId()}}" class="list-group-item">
                                <h6 th:text="${news.getnewsTitle()}"></h6>
                                <p th:text="${news.getnewsWord()}"></p>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="panel panel-danger ">
                    <div class="panel-heading">
                        <h5>政 要 新 闻</h5>
                    </div>
                    <div class="panel-body">
                        <div class="list-group" th:each="news:${list5}">
                            <a th:href="@{'~/news/detail/'+${news.getnewsId()}}" class="list-group-item">
                                <h6 th:text="${news.getnewsTitle()}"></h6>
                                <p th:text="${news.getnewsWord()}"></p>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </body>
    <footer th:replace="~{fragments/footer :: footer}">...</footer>
    </html>

    展开全文
  • 此文档是本人毕业时写的毕业论文 ,毕业设计是基于Web的校园管理系统。使用java+servlet+jsp写的。可提供参考,需要项目的可联系我。

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 1,540
精华内容 616
关键字:

javaweb新闻管理系统

java 订阅