软件工程开学考试

      2021级《软件工程》

课前测试试卷(180分钟)

 

河北省环保监测中心网络新闻发布系统(卷面成绩40分,占课程过程考核20分)

 

1、项目需求:

河北省环保监测中心网络新闻为搭建公众信息交流平台,决定建立新闻发布平台。新闻发布平台按内容包括中心新闻、企业环保信息发布等若干新闻栏目,新闻撰稿人可登陆平台发布新闻,每个新闻栏目至少有一位新闻栏目管理员,负责审查新闻撰稿人所发的新闻稿件,在审查通过后,对应新闻才可以显示在对应新闻栏目上,一般用户登录后才可以看到,另外还可以删除过时或无用的信息。另外,系统管理员可以对用户进行管理和对新闻栏目进行调整。新闻发布流程如下:

2.系统要求与功能设计

2.1 页面要求

(1)通过浏览器查看,能适应常用分辨率;(1分)

(2)布局合理、结构清晰、页面完整;(1分)

(3)网站页面整体风格统一;(1分)

(4)首页为用户登录页面,不同角色用户登录后,进入相应的功能页,要求密码在数据库中加密;(4分)

(5)新闻撰稿人功能页:在线撰写与修改稿件、查看已写稿件及修改意见;

(6)普通用户功能页:浏览相应栏目新闻、用户评论新闻(可匿名)、浏览其他用户评论;

(7)新闻栏目管理员功能页:浏览与管理本栏目待发与已发新闻;

(8)系统管理功能页:用户注册、用户权限管理、新闻栏目管理;

(9)对每页中的查询结果推荐采用分页显示。

2.2 功能要求

(1)在线撰写新闻稿件:新闻撰稿人在线撰写新闻,选择栏目,正式提交;(2分)

(2)查看修改意见:新闻撰稿人查看新闻栏目管理员提出的修改意见;(1分)

(3)修改新闻稿件:新闻撰稿人根据修改意见可以对新闻进行修改;(1分)

(4)查询已经撰写的新闻:新闻撰稿人可以查看自己已经撰写的新闻;(1分)

(5)浏览新闻:普通用户可以浏览栏目的新闻(按照时间倒排);(1分)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

图1 新闻发布流程

 

(6)发表评论回复:普通用户可以对新闻进行发表评论,可选择匿名回复;(1分)

(7)按照一定条件查询新闻:栏目管理员可以按照时间段,新闻关键字等条件进行查询;(2分)

(8)管理待发与已发新闻:新闻栏目管理员可以批准新闻发布、删除不合适新闻、给出撰稿人修改意见、对已发的过时新闻进行删除;(2分)

(9)管理新闻评论回复:新闻栏目管理员可以查看、删除、禁止新闻的回复;(2分)

(10)管理新闻栏目:新开新闻栏目、删除新闻栏目、合并新闻栏目、更改新闻栏目的基本信息;(2分)

(11)用户管理:管理员可以查询用户、批准新用户、暂停用户、为用户赋予角色,普通用户可以修改用户资料。(2分)

2.1,2.2 评分标准:以上各项分值为页面要求和功能要求,各项分值合计(24分);除此以外设计出合理的数据库和数据表(3分),数据库连接正常(2分),设计出用户权限管理(6分)。

2.3 网站发布

(1)网站制作完成后需指定一台机器作为服务器发布。

(2)在其他主机上可正常浏览。

评分标准:能够在Tomcat服务器中正确部署(3分),其它主机可正常浏览(2分);

 

2.4 注意事项

(1)网站首页(登录页) 统一使用index.*命名。(*表示源文件的后缀名)。

(2)请选手填写以下表格:

网站文件路径

 

网站数据库名称

 

角色名

登录名

密码

 

 

 

 

 

 

 

 

 

 

 

 

 Dao.java

  1 package com;
  2 import java.sql.Connection;
  3 import java.sql.ResultSet;
  4 import java.sql.SQLException;
  5 import java.sql.Statement;
  6 import java.util.ArrayList;
  7 import java.util.List;
  8 public class Dao {
  9     public boolean deng(String mi,String username,String jue)
 10     {
 11         String sql="select * from yong where username='"+username+"'and mi='"+mi+"'and jue='"+jue+"'";
 12         boolean f=false;
 13         Connection conn = Util.getConn();
 14         Statement state = null;
 15         ResultSet rs = null;
 16         try {
 17             state = conn.createStatement();
 18             rs = state.executeQuery(sql);
 19             while (rs.next()) {
 20                 f = true;
 21 
 22             }
 23         } catch (SQLException e) {
 24             e.printStackTrace();
 25         } finally {
 26             Util.close(rs, state, conn);
 27         }
 28         return f;
 29     }
 30     public void  addxie (xiewen xiewen)
 31     {
 32         String sql="insert into xiewen(xinwen,lanmu)values('"+xiewen.getXin()+"','"+xiewen.getLanmu()+"')";
 33         Connection conn = Util.getConn();
 34         Statement state = null;
 35         try {
 36             state = conn.createStatement();
 37             state.executeUpdate(sql);
 38         } catch (Exception e) {
 39             e.printStackTrace();
 40         } finally {
 41 //关闭连接
 42             Util.close(state, conn);
 43         }
 44     }
 45     public void  zhuce (yong yong)
 46     {
 47         String sql="insert into yong(username,mi,jue)values('"+yong.getUsername()+"','"+yong.getPassword()+"','"+yong.getJue()+"')";
 48         Connection conn = Util.getConn();
 49         Statement state = null;
 50         try {
 51             state = conn.createStatement();
 52             state.executeUpdate(sql);
 53         } catch (Exception e) {
 54             e.printStackTrace();
 55         } finally {
 56 //关闭连接
 57             Util.close(state, conn);
 58         }
 59     }
 60     public List<xiewen> liu ()
 61     {
 62         List<xiewen> list=new ArrayList<>();
 63         Connection conn = Util.getConn();
 64         Statement state = null;
 65         ResultSet rs = null;
 66         xiewen xiewen=null;
 67         String sql="select * from xiewen";
 68         try {
 69             state = conn.createStatement();
 70             rs = state.executeQuery(sql);
 71             while (rs.next()) {
 72                 String xinwen1 = rs.getString("xinwen");
 73                 String lanmu= rs.getString("lanmu");
 74 
 75                 xiewen=new xiewen(xinwen1,lanmu);
 76                 list.add(xiewen);
 77             }
 78         } catch (Exception e) {
 79             e.printStackTrace();
 80         } finally {
 81             Util.close(rs, state, conn);
 82         }
 83 
 84         return list;
 85     }
 86     public List<xiewen> chaxin(xiewen xiewen)
 87     {
 88         List<xiewen> list=new ArrayList<>();
 89         Connection conn = Util.getConn();
 90         Statement state = null;
 91         ResultSet rs = null;
 92         String sql="select * from xiewen where xinwen='"+xiewen.getXin()+"'or lanmu='"+xiewen.getLanmu()+"'";
 93         try {
 94             state = conn.createStatement();
 95             rs = state.executeQuery(sql);
 96             while (rs.next()) {
 97                 String xinwen1 = rs.getString("xinwen");
 98                 String lanmu= rs.getString("lanmu");
 99 
100                 xiewen=new xiewen(xinwen1,lanmu);
101                 list.add(xiewen);
102             }
103         } catch (Exception e) {
104             e.printStackTrace();
105         } finally {
106             Util.close(rs, state, conn);
107         }
108 
109         return list;
110     }
111     public List<pinglun> liug ()
112     {
113         List<pinglun> list=new ArrayList<>();
114         Connection conn = Util.getConn();
115         Statement state = null;
116         ResultSet rs = null;
117         pinglun pinglun=null;
118         String sql="select * from ping";
119         try {
120             state = conn.createStatement();
121             rs = state.executeQuery(sql);
122             while (rs.next()) {
123                 String pinglun1 = rs.getString("pinglun");
124 
125                 pinglun=new pinglun(pinglun1);
126                 list.add(pinglun);
127             }
128         } catch (Exception e) {
129             e.printStackTrace();
130         } finally {
131             Util.close(rs, state, conn);
132         }
133 
134         return list;
135     }
136     public List<yong> chayong ()
137     {
138         List<yong> list=new ArrayList<>();
139         Connection conn = Util.getConn();
140         Statement state = null;
141         ResultSet rs = null;
142         yong yong =null;
143         String sql="select * from yong";
144         try {
145             state = conn.createStatement();
146             rs = state.executeQuery(sql);
147             while (rs.next()) {
148                 String username = rs.getString("username");
149                 String password = rs.getString("password");
150                 String jue = rs.getString("jue");
151 
152                 yong=new yong(username,password,jue);
153                 list.add(yong);
154             }
155         } catch (Exception e) {
156             e.printStackTrace();
157         } finally {
158             Util.close(rs, state, conn);
159         }
160         return list;
161     }
162 public void pinglun(pinglun pinglun)
163 {
164     String sql="insert into ping(pinglun)values('"+pinglun.getPinglun()+"')";
165     Connection conn = Util.getConn();
166     Statement state = null;
167     try {
168         state = conn.createStatement();
169         state.executeUpdate(sql);
170     } catch (Exception e) {
171         e.printStackTrace();
172     } finally {
173 //关闭连接
174         Util.close(state, conn);
175     }
176 }
177 
178 }

service.java

 1 package com;
 2 
 3 import java.util.List;
 4 
 5 public class service {
 6     Dao cDao=new Dao();
 7     public  boolean deng(String mi,String username,String jue)
 8     {boolean f=false;
 9         f=cDao.deng(mi,username,jue);
10         return f ;
11     }
12     public  void addxie(xiewen xiewen)
13     {
14     cDao.addxie(xiewen);}
15     public List<xiewen> liu()
16     {
17         return cDao.liu();
18     }
19     public List<xiewen> chaxin(xiewen xiewen)
20     {
21         return cDao.chaxin(xiewen);
22     }
23     public void pinglun(pinglun pinglun)
24     {
25       cDao.pinglun(pinglun);
26     }
27     public List<pinglun> liug()
28     {
29         return cDao.liug();
30     }
31    public void zhuce(yong yong)
32     {
33        cDao.zhuce(yong);
34     }
35 }

servlet.java

  1 package com;
  2 import javax.servlet.*;
  3 import javax.servlet.http.*;
  4 import javax.servlet.annotation.*;
  5 import java.io.IOException;
  6 import java.util.ArrayList;
  7 import java.util.List;
  8 @WebServlet("/servlet")
  9 public class servlet extends HttpServlet{
 10     service service=new service();
 11     @Override
 12     protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
 13         req.setCharacterEncoding("utf-8");
 14         String method = req.getParameter("method");
 15         if ("deng".equals(method)) {
 16             deng(req, resp);
 17         }
 18         else if("addxie".equals(method))
 19         {
 20             addxie(req,resp);
 21         }
 22         else if("liu".equals(method))
 23         {
 24             liu(req,resp);
 25         }
 26         else if("pinglun".equals(method))
 27         {
 28             pinglun(req,resp);
 29         }
 30         else if("liug".equals(method))
 31         {
 32             liug(req,resp);
 33         }
 34         else if("chaxin".equals(method))
 35         {
 36             chaxin(req,resp);
 37         }
 38         else if("zhuce".equals(method))
 39         {
 40             zhuce(req,resp);
 41         }
 42     }
 43     private void deng(HttpServletRequest req,HttpServletResponse resp)throws ServletException,IOException{
 44         req.setCharacterEncoding("utf-8");
 45         String username=req.getParameter("username");
 46         String mi=req.getParameter("mi");
 47         String a=req.getParameter("jue");
 48         String jue=req.getParameter("jue");
 49         if(service.deng(mi,username,jue)==false)
 50         {
 51             req.setAttribute("message","用户或密码不正确");
 52             req.getRequestDispatcher("login.jsp").forward(req,resp);
 53         }
 54         else
 55         {if(a.equals("用户"))
 56         {
 57             req.setAttribute("message","登录成功");
 58            // xue ce=service.dengx(username);
 59            // req.setAttribute("ce",ce);
 60             req.getRequestDispatcher("yonghu.jsp").forward(req,resp);
 61         }
 62         else if(a.equals("新闻栏目管理员")){
 63             req.setAttribute("message","登录成功");
 64             //te ce=service.dengt(username);
 65             //req.setAttribute("ce",ce);
 66             // Cookie cookie=new Cookie(username,"s");
 67             //resp.addCookie(cookie);
 68             req.getRequestDispatcher("guan.jsp").forward(req,resp);
 69 
 70         }
 71         else if(a.equals("新闻撰稿人")){
 72             req.setAttribute("message","登录成功");
 73             //te ce=service.dengt(username);
 74             //req.setAttribute("ce",ce);
 75             // Cookie cookie=new Cookie(username,"s");
 76             //resp.addCookie(cookie);
 77             req.getRequestDispatcher("xinwenr.jsp").forward(req,resp);
 78 
 79         }
 80             //req.getRequestDispatcher("login.jsp").forward(req,resp);
 81         }
 82 
 83     }
 84     protected  void addxie(HttpServletRequest req,HttpServletResponse resp)throws ServletException,IOException{
 85         String xinwen = req.getParameter("xinwen");
 86         String lanmu = req.getParameter("lanmu");
 87         xiewen xiewen =new xiewen(xinwen,lanmu);
 88         service.addxie(xiewen);
 89         req.setAttribute("message","新添成功");
 90         req.getRequestDispatcher("xinwenr.jsp").forward(req,resp);
 91     }
 92     protected  void pinglun(HttpServletRequest req,HttpServletResponse resp)throws ServletException,IOException{
 93         String pinglun = req.getParameter("pinglun");
 94         pinglun pinglun1 =new pinglun(pinglun);
 95         service.pinglun(pinglun1);
 96         req.setAttribute("message","新添成功");
 97         req.getRequestDispatcher("yonghu.jsp").forward(req,resp);
 98     }
 99     protected  void liu(HttpServletRequest req,HttpServletResponse resp)throws ServletException,IOException {
100         req.setCharacterEncoding("utf-8");
101 
102         List<xiewen> list=new ArrayList<>();
103         list=service.liu();
104         req.setAttribute("list",list);
105         req.getRequestDispatcher("liu.jsp").forward(req,resp);
106     }
107     protected  void chaxin(HttpServletRequest req,HttpServletResponse resp)throws ServletException,IOException {
108         req.setCharacterEncoding("utf-8");
109         String xinwen = req.getParameter("xinwen");
110         String lanmu = req.getParameter("lanmu");
111         xiewen xiewen =new xiewen(xinwen,lanmu);
112         List<xiewen> list=new ArrayList<>();
113         list=service.chaxin(xiewen);
114         req.setAttribute("list",list);
115         req.getRequestDispatcher("chag.jsp").forward(req,resp);
116     }
117     protected  void liug(HttpServletRequest req,HttpServletResponse resp)throws ServletException,IOException {
118         req.setCharacterEncoding("utf-8");
119 
120         List<pinglun> list=new ArrayList<>();
121         list=service.liug();
122         req.setAttribute("list",list);
123         req.getRequestDispatcher("liug.jsp").forward(req,resp);
124     }
125     protected  void zhuce(HttpServletRequest req,HttpServletResponse resp)throws ServletException,IOException {
126         req.setCharacterEncoding("utf-8");
127         String username = req.getParameter("username");
128         String mi = req.getParameter("mi");
129         String jue="用户" ;
130         yong yong =new yong(username,mi,jue);
131        service.zhuce(yong);
132 
133         req.getRequestDispatcher("guan.jsp").forward(req,resp);
134     }
135     @Override
136     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
137     }
138     @Override
139     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
140     }
141 }

login.jsp

 1 <%--
 2   Created by IntelliJ IDEA.
 3   User: 86155
 4   Date: 2022/11/4
 5   Time: 14:28
 6   To change this template use File | Settings | File Templates.
 7 --%>
 8 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 9 <%
10     Object message = request.getAttribute("message");
11     if(message!=null && !"".equals(message)){
12 %>
13 <script type="text/javascript">
14     alert("<%=request.getAttribute("message")%>");
15 </script>
16 <%} %>
17 <html>
18 <head>
19     <title>登录</title>
20 </head>
21 <body>
22 <div align="center">
23     <h1 style="color: black;">登陆界面</h1>
24     <form  action="servlet?method=deng"method="post" >
25         <div class="a">
26             登录用户名<input type="text" name="username" id="username">
27         </div>
28         <div class="register">
29             登录密码:<input type="text"name="mi"id="mi"class="inp">
30             <a class="message">请输入密码</a>
31         </div>
32         <div class="a">
33             <p> 请选择角色</p>
34             新闻栏目管理员 <input type="checkbox"name="jue" value="新闻栏目管理员">
35             新闻撰稿人 <input type="checkbox"name="jue" value="新闻撰稿人">
36             用户 <input type="checkbox"name="jue" value="用户">
37         </div>
38         <div class="a">
39             <button type="submit" id="ok" >登录</button>
40             <input type="reset">
41             <input type="button" onclick="location.href='zhuce.jsp'">
42         </div>
43     </form>
44 </div>
45 </body>
46 <script type="text/javascript">
47     var password = document.querySelector('.inp');
48     var message = document.querySelector('.message');
49     password.onblur = function() {
50         if(this.value.length<=0)
51         {
52             message.innerHTML= '密码不为空';
53         }else{
54             message.innerHTML='';
55         }
56     }
57 </script>
58 </html>

liu.jsp

<%--
  Created by IntelliJ IDEA.
  User: 86155
  Date: 2022/11/4
  Time: 14:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    Object message = request.getAttribute("message");
    if(message!=null && !"".equals(message)){
%>
<script type="text/javascript">
    alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<html>
<head>
    <title>登录</title>
</head>
<body>
<div align="center">
    <h1 style="color: black;">登陆界面</h1>
    <form  action="servlet?method=deng"method="post" >
        <div class="a">
            登录用户名<input type="text" name="username" id="username">
        </div>
        <div class="register">
            登录密码:<input type="text"name="mi"id="mi"class="inp">
            <a class="message">请输入密码</a>
        </div>
        <div class="a">
            <p> 请选择角色</p>
            新闻栏目管理员 <input type="checkbox"name="jue" value="新闻栏目管理员">
            新闻撰稿人 <input type="checkbox"name="jue" value="新闻撰稿人">
            用户 <input type="checkbox"name="jue" value="用户">
        </div>
        <div class="a">
            <button type="submit" id="ok" >登录</button>
            <input type="reset">
            <input type="button" onclick="location.href='zhuce.jsp'">
        </div>
    </form>
</div>
</body>
<script type="text/javascript">
    var password = document.querySelector('.inp');
    var message = document.querySelector('.message');
    password.onblur = function() {
        if(this.value.length<=0)
        {
            message.innerHTML= '密码不为空';
        }else{
            message.innerHTML='';
        }
    }
</script>
</html>

cha.jsp

 1 <%--
 2   Created by IntelliJ IDEA.
 3   User: 86155
 4   Date: 2022/11/4
 5   Time: 14:28
 6   To change this template use File | Settings | File Templates.
 7 --%>
 8 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 9 <%
10     Object message = request.getAttribute("message");
11     if(message!=null && !"".equals(message)){
12 %>
13 <script type="text/javascript">
14     alert("<%=request.getAttribute("message")%>");
15 </script>
16 <%} %>
17 <html>
18 <head>
19     <title>登录</title>
20 </head>
21 <body>
22 <div align="center">
23     <h1 style="color: black;">登陆界面</h1>
24     <form  action="servlet?method=deng"method="post" >
25         <div class="a">
26             登录用户名<input type="text" name="username" id="username">
27         </div>
28         <div class="register">
29             登录密码:<input type="text"name="mi"id="mi"class="inp">
30             <a class="message">请输入密码</a>
31         </div>
32         <div class="a">
33             <p> 请选择角色</p>
34             新闻栏目管理员 <input type="checkbox"name="jue" value="新闻栏目管理员">
35             新闻撰稿人 <input type="checkbox"name="jue" value="新闻撰稿人">
36             用户 <input type="checkbox"name="jue" value="用户">
37         </div>
38         <div class="a">
39             <button type="submit" id="ok" >登录</button>
40             <input type="reset">
41             <input type="button" onclick="location.href='zhuce.jsp'">
42         </div>
43     </form>
44 </div>
45 </body>
46 <script type="text/javascript">
47     var password = document.querySelector('.inp');
48     var message = document.querySelector('.message');
49     password.onblur = function() {
50         if(this.value.length<=0)
51         {
52             message.innerHTML= '密码不为空';
53         }else{
54             message.innerHTML='';
55         }
56     }
57 </script>
58 </html>

xinwenr.jsp

<%--
  Created by IntelliJ IDEA.
  User: 86155
  Date: 2023/2/13
  Time: 15:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    Object message = request.getAttribute("message");
    if(message!=null && !"".equals(message)){

%>
<script type="text/javascript">
    alert("<%=request.getAttribute("message")%>");
</script>
<%} %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div align="center">
    <input type="button" value="在线撰写与修改稿件" onclick= "location.href='xie.jsp'">
    <input type="button" value="查看已写稿件及修改意见" onclick= "location.href='cha.jsp'">
    <form action="servlet?method=xchak" method="post">
        <input type="submit" value="查询选课"></form>
    <form action="servlet?method=kebiao&kb=${ke.kb}" method="post">
        <input type="submit" value="查询课表">
    </form>
</div>
</body>
</html>

xie.jsp

<%--
  Created by IntelliJ IDEA.
  User: 86155
  Date: 2023/2/13
  Time: 15:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div align="center">
    <form action="servlet?method=addxie" method="post" >
        <tr align="center" border="1">
            <tr><th>新闻</th><tr><input type="text"name="xinwen" id="winwen"></tr>
        <tr> <th>标题</th><input type="text"name="biaoti" ></tr>
               <tr>日期<th></th> <input type="text"name="qi" ></tr>
                <input type="radio" name="lanmu"value="社会">社会
                <input type="radio" name="lanmu"value="娱乐">娱乐
            <tr><th>tijiao</th><td><input type="submit" value="tijiao"></td></tr>
        </form>
</div>
</body>
</html>

<%--
  Created by IntelliJ IDEA.
  User: 86155
  Date: 2023/2/13
  Time: 16:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri= "http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<th>新闻</th>
<c:forEach items="${list}" var="list">
    <td><input type="text" name="xinwen" value="${list.xin}"></td>
    <th>栏目</th> <td><input type="text" name="lanmu" value="${list.lanmu}"></td>
    <form action="servlet?method=liug"method="post">
        <td><input type="submit" value="查看修改意见"></td> </form>
</c:forEach>
</body>
</html>

guan.jsp

 1 <%--
 2   Created by IntelliJ IDEA.
 3   User: 86155
 4   Date: 2023/2/13
 5   Time: 15:07
 6   To change this template use File | Settings | File Templates.
 7 --%>
 8 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 9 <html>
10 <head>
11     <title>Title</title>
12 </head>
13 <body>
14 <form action="servlet?method=chayong" method="post">
15     <input type="submit" value="查询用户" >
16 </form>
17 查询新闻<input type="button" onclick="location.href='chaxin.jsp'" value="查询新闻">
18 </body>
19 </html>

yonghu.jsp

 1 <%--
 2   Created by IntelliJ IDEA.
 3   User: 86155
 4   Date: 2023/2/13
 5   Time: 15:01
 6   To change this template use File | Settings | File Templates.
 7 --%>
 8 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 9 <%
10     Object message = request.getAttribute("message");
11     if(message!=null && !"".equals(message)){
12 
13 %>
14 <script type="text/javascript">
15     alert("<%=request.getAttribute("message")%>");
16 </script>
17 <%} %>
18 <html>
19 <head>
20     <title></title>
21 </head>
22 <body>
23 <div align="center">
24     <form action="servlet?method=liu" method="post">
25         <input type="submit" value="浏览相应栏目新闻">浏览相应栏目新闻
26     </form>
27     <form action="servlet?method=liug" method="post">
28         <input type="submit" value="浏览其他用户评论">浏览其他用户评论
29     </form>
30 </div>
31 </body>
32 </html>

总结:很多不会,没写完,仍然去练习。

 

posted @ 2023-02-13 19:48  阿飞藏泪  阅读(25)  评论(0编辑  收藏  举报
1 2 3
4