进度八(10.26)

Posted vvxvv

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了进度八(10.26)相关的知识,希望对你有一定的参考价值。

技术图片

 

 技术图片

技术图片
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
    .a{
        margin-top: 20px;
    }
    .b{
        font-size: 20px;
        width: 160px;
        color: white;
        background-color: greenyellow;
    }
    .tb, td {
        border: 1px solid black;
        font-size: 22px;
    }
</style>
</head>
<body>
    <div align="center">
        <h1 style="color: red;">征集表信息总览</h1>
        <table class="tb">
            <tr>
                <td>技术需求名称</td>
                <td>技术需求解决方式</td>
                <td>科技活动类型</td>
                <td>归口管理部门</td>
                <td>所属机构</td>
                <td>电子信箱</td>
                <td>联系人</td>
                <td>手机</td>
                <td>审核状态</td>
                <td>详情</td>
                <td>修改</td>
                <td>删除</td>
            </tr>
            <c:forEach items="${table}" var="item">
                <tr>
                    <td>${item.jsxqmc}</td>
                    <td>${item.jsxqjjfs}</td>
                    <td>${item.kjhdlx}</td>
                    <td>${item.gkglbm}</td>
                    <td>${item.jgqc}</td>
                    <td>${item.dzxx}</td>
                    <td>${item.lxr}</td>
                    <td>${item.sj}</td>
                    <td>${item.status}</td>
                    <td><a href="AdminServlet?method=getCourseById&id=${item.wjid}">详情</a></td>
                    <td><a href="AdminServlet?method=getCourseById&id=${item.wjid}">修改</a></td>
                    <td><a href="AdminServlet?method=getCourseById&id=${item.wjid}">删除</a></td>
                </tr>
            </c:forEach>
        </table>
    </div>
</body>
</html>
View Code
技术图片
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
    .a{
        margin-top: 20px;
    }
    .b{
        font-size: 20px;
        width: 160px;
        color: white;
        background-color: greenyellow;
    }
    .tb, td {
        border: 1px solid black;
        font-size: 22px;
    }
</style>
</head>
<body>
    <div align="center">
        <h1 style="color: red;">用户信息总览</h1>
        <table class="tb">
            <tr>
                <td>昵称</td>
                <td>姓名</td>
                <td>性别</td>
                <td>机构</td>
                <td>权限</td>
                <td>详情</td>
                <td>修改</td>
                <td>删除</td>
            </tr>
            <c:forEach items="${user}" var="item">
                <tr>
                    <td>${item.username}</td>
                    <td>${item.name}</td>
                    <td>${item.sex}</td>
                    <td>${item.jgmc}</td>
                    <td>${item.power}</td>
                    <td><a href="AdminServlet?method=getCourseById&id=${item.id}">详情</a></td>
                    <td><a href="AdminServlet?method=getCourseById&id=${item.id}">修改</a></td>
                    <td><a href="AdminServlet?method=getCourseById&id=${item.id}">删除</a></td>
                </tr>
            </c:forEach>
        </table>
    </div>
</body>
</html>
View Code
技术图片
package servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.Table;
import dao.AdminDao;

@WebServlet("/AllTableServlet")
public class AllTableServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;
       
    public AllTableServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        request.setCharacterEncoding("utf-8");
        List<Table> table = AdminDao.listtable();
        request.setAttribute("table", table);
        request.getRequestDispatcher("admin/alltable.jsp").forward(request,response);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        doGet(request, response);
    }

}
View Code
技术图片
package servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.User;
import dao.AdminDao;

@WebServlet("/AllUserServlet")
public class AllUserServlet extends HttpServlet {
    
    private static final long serialVersionUID = 1L;
    
    public AllUserServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        request.setCharacterEncoding("utf-8");
        List<User> user = AdminDao.listuser();
        request.setAttribute("user", user);
        request.getRequestDispatcher("admin/alluser.jsp").forward(request,response);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        doGet(request, response);
    }

}
View Code
技术图片
package dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import bean.Table;
import bean.User;
import util.DBUtil;

public class AdminDao {
    
    public static List<User> listuser() {
        String sql = "select * from t_user";
        List<User> list = new ArrayList<>();
        Connection conn = DBUtil.getConnection();
        Statement state = null;
        ResultSet rs = null;
        try {
            state = conn.createStatement();
            rs = state.executeQuery(sql);            
            while (rs.next()) {
                User user = new User();
                int id = rs.getInt("id");
                String username = rs.getString("username");
                String name = rs.getString("name");
                String sex = rs.getString("sex");
                String jgmc = rs.getString("jgmc");
                int power = rs.getInt("power");
                
                user.setId(id);
                user.setUsername(username);
                user.setName(name);
                user.setSex(sex);
                user.setJgmc(jgmc);
                user.setPower(power);
                list.add(user);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            DBUtil.close(rs, state, conn);
        }    
        return list;
    }
    
    public static List<Table> listtable() {
        String sql = "select * from t_table";
        List<Table> list2 = new ArrayList<>();
        Connection conn = DBUtil.getConnection();
        Statement state = null;
        ResultSet rs = null;
        try {
            state = conn.createStatement();
            rs = state.executeQuery(sql);            
            while (rs.next()) {
                
                Table table = new Table();
                
                int wjid = rs.getInt("wjid");
                String jsxqmc = rs.getString("jsxqmc");
                String jsxqjjfs = rs.getString("jsxqjjfs");
                String kjhdlx = rs.getString("kjhdlx");
                String gkglbm = rs.getString("gkglbm");
                String jgqc = rs.getString("jgqc");
                String dzxx = rs.getString("dzxx");
                String lxr = rs.getString("lxr");
                String sj = rs.getString("sj");
                int status = rs.getInt("status");
                
                table.setWjid(wjid);
                table.setJsxqmc(jsxqmc);
                table.setJsxqjjfs(jsxqjjfs);
                table.setKjhdlx(kjhdlx);
                table.setGkglbm(gkglbm);
                table.setJgqc(jgqc);
                table.setDzxx(dzxx);
                table.setLxr(lxr);
                table.setSj(sj);
                table.setStatus(status);

                list2.add(table);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            DBUtil.close(rs, state, conn);
        }    
        return list2;
    }

}
View Code

 

以上是关于进度八(10.26)的主要内容,如果未能解决你的问题,请参考以下文章

tp3,2小结10.26

Linux20180511八周一次课cron chkconf systemd unit target

Linux20180511八周一次课cron chkconf systemd unit target

Linux20180511八周一次课cron chkconf systemd unit target

Linux20180511八周一次课cron chkconf systemd unit target

Linux20180511八周一次课cron chkconf systemd unit target