基于javaweb+jsp的新生报道管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Layui Ajax)

基于javaweb+jsp的新生报道管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Layui Ajax)

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Layui Ajax

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可修改

开发工具:eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

                layer.msg(data.noticeName + ' 删除成功!');
                // });
            } else if (layEvent === 'edit') { //编辑
                layer.open({
                    type: 2,
                    area: ['800px', '550px'],
                    fixed: false, //不固定
                    maxmin: true,
                    content: 'noticeEditPre?id=' + data.id
                });
                obj.update({});//同步更新缓存对应的值
            } else if (layEvent === 'info') { //详情
                layer.open({
        vo.setUserText(Util.decode(request, "userText"));
        vo.setUserType(Util.decode(request, "userType"));
        userService.update(vo);
        this.redirectList(request, response);
    }

    /**
     * 获取用户的详细信息(详情页面与编辑页面要显示该用户的详情)并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping({"userGet", "userEditPre"})
    public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");//取出主键id
        User vo = userService.get(id);
        request.getSession().setAttribute("vo", vo);
    public Baodao get(Serializable id) {
        return this.baodaoMapper.findById(id);
    }

    //@Override
    public Map<String, Object> list(Map<String, Object> params) {
        Map<String, Object> resultMap = new HashMap();
        resultMap.put("totalCount", this.baodaoMapper.getAllCount(params));
        resultMap.put("list", this.baodaoMapper.findAllSplit(params));
        return resultMap;
    }
}
package com.demo.service.impl;

import com.demo.dao.NoticeMapper;
import com.demo.service.NoticeService;
import com.demo.vo.Notice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;

            line-height: 120px;
        }

        .login-wrapper .form-wrapper .input-item {
            display: block;
            width: 100%;
            margin-bottom: 20px;
            border: 0;
            padding: 10px;
            border-bottom: 1px solid rgb(128, 125, 125);
            font-size: 15px;
            outline: none;
        }

        .login-wrapper .form-wrapper .input-item ::placeholder {
            text-transform: uppercase;
        }

        .login-wrapper .form-wrapper .btn {
            text-align: center;
            padding: 10px;
            margin-top: 40px;
            width: 100%;
            background-image: linear-gradient(to right, #a6c1ee, #fbc2eb);
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("noticeEdit")
    public void edit(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Notice vo = new Notice();
        vo.setId(Long.valueOf(Util.decode(request, "id")));
        vo.setNoticeName(Util.decode(request, "noticeName"));
        vo.setNoticeText(Util.decode(request, "noticeText"));
        vo.setNoticeType(Util.decode(request, "noticeType"));
        vo.setCreateDate(Util.decode(request, "createDate"));
        noticeService.update(vo);
        this.redirectList(request, response);
    }

    /**
     * 获取公告的详细信息(详情页面与编辑页面要显示该公告的详情)并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
        String searchColumn = Util.decode(request, "searchColumn");
        String keyword = Util.decode(request, "keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(baodaoService.list(params).get("list")));
    }
}
package com.demo.controller;

import com.demo.util.Util;
import com.demo.service.UserService;
import com.demo.vo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
        String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
        response.sendRedirect("baodao_" + to + ".jsp");
    }

    /**
     * 根据条件查询报道的列表并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("baodaoList")
    public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectList(request, response);
    }
                    type: 2,
                    area: ['800px', '550px'],
                    fixed: false, //不固定
                    maxmin: true,
                    content: 'user_add.jsp'
                });
            } else {
                //layer.alert('这是工具栏右侧自定义的一个图标按钮');
            }
        });
        //搜索
        let $ = layui.$, active = {
            reload: function () {
                let url = 'userList?keyword=' + $('#search_keyword').val() + '&searchColumn=' + $('#searchColumn').val();
                //执行重载
                <input type="password" name="password2" id="password2" placeholder="确认密码" class="input-item">
                <input class="btn" type="submit" value="注册"/>
            </form>
        </div>
        <div class="msg">
            You have account!<a href='login.jsp' style="font-weight: bold;">Login</a>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    //提交之前进行检查,如果return false,则不允许提交
    function check() {
        //根据ID获取值
        let username = document.getElementById("username").value;
        let password = document.getElementById("password").value;
        let password2 = document.getElementById("password2").value;
        if (username == "") {
            alert("用户名不能为空!");
            return false;
        }
        if (password == "") {
            alert("密码不能为空!");
            return false;
        }
        if (password2 != password) {
            alert("密码输入不一致!");

    <!--获取-->
    <select id="findById" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_notice` WHERE `id` = #{id}
    </select>

    <!--列表-->
    <select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_notice`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
            </if>
            1=1
        </where>
        ORDER BY id ASC
        <if test="startIndex != null and pageSize != null">
            LIMIT #{startIndex},#{pageSize};
        </if>
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <!-- 侧边栏 -->
                <jsp:include page="menu.jsp">
                    <jsp:param value="active" name="User_active"/>
                </jsp:include>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <div class="search_style" style="padding-top: 10px;padding-left: 15px;">
            <div class="searchTable">
                搜索:
                <div class="layui-inline">
                    <input class="layui-input" name="search_keyword" id="search_keyword" autocomplete="off" placeholder="姓名">
                    <input type="hidden" class="layui-input" name="searchColumn" id="searchColumn" autocomplete="off" value="real_name">
                </div>

运行环境

Java≥6、Tomcat≥7.0、MySQL≥5.5

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

技术框架

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Layui Ajax

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可修改

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

登录、注册、退出、用户模块、公告模块、报道模块的增删改查管理

20220319003056

20220319003057

20220319003058

20220319003059

20220319003100

20220319003101

20220319003102

20220319003103

20220319003104

document

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值