Java教程

基于javaweb+jsp的校园失物招领管理系统

本文主要是介绍基于javaweb+jsp的校园失物招领管理系统,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

基于javaweb+jsp的校园失物招领管理系统

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap.

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

开发工具:idea或eclipse或myeclipse

部分代码实现JSP

            alert("捡到时间不能为空!");
            return false;
        }
        if (document.getElementById("zhaolinAddress").value.trim().length == 0) {
            alert("捡到地点不能为空!");
            return false;
        }
        if (document.getElementById("zhaolinZhancun").value.trim().length == 0) {
            alert("暂存地点不能为空!");
            return false;
        }
        if (document.getElementById("zhaolinRen").value.trim().length == 0) {
            alert("联系人不能为空!");
            return false;
        }
        if (document.getElementById("zhaolinPhone").value.trim().length == 0) {
            alert("联系方式不能为空!");
            return false;
        }
        return true;
                <td width="12%">备注:</td><td><textarea id="xunwuText" name="xunwuText" style="width: 60%; height: 100px;padding: 0px 17px;" placeholder="请输入内容......">${vo.xunwuText}</textarea></td>
            </tr>
        </table>
        <br>
        <br>
        <br>
        &nbsp;&nbsp;&nbsp;<button type="submit" class="btn btn-rect btn-grad btn-warning btn-sm">提交</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" class="btn btn-rect btn-grad btn-warning btn-sm" onclick="javascript:history.back(-1);">取消</button>
    </form>
</div>

</body>
<script type="text/javascript">
    //提交之前进行检查,如果return false,则不允许提交
    function check() {
        //根据ID获取值
        if (document.getElementById("xunwuName").value.trim().length == 0) {
            alert("物品名称不能为空!");
            return false;
        }
        if (document.getElementById("xunwuDate").value.trim().length == 0) {
            alert("丢失时间不能为空!");
    <br>
    <form action="ZhaolinServlet?action=add" method="post" onsubmit="return check()">
        <table class="index-content-table-add">
            <tr>
                <td width="12%">物品名称:</td><td><input class="index-content-table-td-add" type="text" id="zhaolinName" name="zhaolinName" value=""/></td>
            </tr>
            <tr>
                <td width="12%">捡到时间:</td><td><input class="index-content-table-td-add" type="text" id="zhaolinDate" name="zhaolinDate" value=""/></td>
            </tr>
            <tr>
                <td width="12%">捡到地点:</td><td><input class="index-content-table-td-add" type="text" id="zhaolinAddress" name="zhaolinAddress" value=""/></td>
            </tr>
    <div class="index-content-operation">
        <a class="info-detail">修改寻物</a>
        <br>
        <br>
    </div>
    <br>
    <form action="XunwuServlet?action=edit" method="post" onsubmit="return check()">
        <input type="hidden" id="id" name="id" value="${vo.id}"/>
        
        <table class="index-content-table-add">
            <tr>
                <td width="12%">物品名称:</td><td><input class="index-content-table-td-add" type="text" id="xunwuName" name="xunwuName" value="${vo.xunwuName}"/></td>
            </tr>
            <tr>
                <td width="12%">丢失时间:</td><td><input class="index-content-table-td-add" type="text" id="xunwuDate" name="xunwuDate" value="${vo.xunwuDate}"/></td>
            </tr>
            <tr>
                <td width="12%">丢失地点:</td><td><input class="index-content-table-td-add" type="text" id="xunwuAddress" name="xunwuAddress" value="${vo.xunwuAddress}"/></td>
        }
        if (document.getElementById("xunwuAddress").value.trim().length == 0) {
            alert("丢失地点不能为空!");
            return false;
        }
        if (document.getElementById("xunwuXunwuren").value.trim().length == 0) {
            alert("遗失人不能为空!");
            return false;
        }
        if (document.getElementById("xunwuPhone").value.trim().length == 0) {
            alert("联系方式不能为空!");
            return false;
        }
        return true;
    }
</script>
            <tr>
                <td>物品名称:<b>${vo.zhaolinName}</b></td>
            </tr>
            <tr>
                <td>捡到时间:<b>${vo.zhaolinDate}</b></td>
            </tr>
            <tr>
                <td>捡到地点:<b>${vo.zhaolinAddress}</b></td>
            </tr>
            <tr>
                <td>类型:
                    <b>${vo.zhaolinType}</b>
            </tr>
            <tr>
                <td>暂存地点:<b>${vo.zhaolinZhancun}</b></td>
            </tr>
            <tr>
                <td>联系人:<b>${vo.zhaolinRen}</b></td>
            </tr>
            <tr>
                <td>联系方式:<b>${vo.zhaolinPhone}</b></td>
            </tr>
            <tr>
                <td>备注:<b>${vo.zhaolinText}</b></td>
            </tr>
        </table>
        <br>
        <button type="button" class="btn btn-rect btn-grad btn-warning btn-sm" onclick="javascript:history.back(-1);">返回</button>
    </form>
</div>
</body>
</html>

                            <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if>
                    οnclick="window.location.href='XunwuServlet?action=editPre&id=${vo.id}'">编辑</button>&nbsp;
                    <button class="btn btn-rect btn-grad btn-success btn-sm" style="padding: 0px 1px;" <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> οnclick="if(window.confirm('将要删除:${vo.xunwuName}?'))window.location.href='XunwuServlet?action=delete&id=${vo.id}'">删除</button>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <div style="float: right;padding-right: 10px;color: #515151;"><jsp:include page="split.jsp"/></div>
</div>
</body>
<script>
    function searchList() {
        window.location.href = "XunwuServlet?action=list&searchColumn="+document.getElementById("searchColumn").value+"&keyword=" + document.getElementById("search_keyword").value;
    }
</script>
</html>

<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>添加招领</title>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<jsp:include page="menu.jsp"/>
<div class="index-content">
    <div class="index-content-operation">
        <a class="info-detail">添加招领</a>
        <br>
        <br>
</head>
<body>
<jsp:include page="menu.jsp"/>
<div class="index-content">
    <div class="index-content-operation">
        <a class="info-detail">寻物管理</a>
        <br>
        <br>
    </div>
    <br>
    <div class="index-content-operation">
        <button class="btn btn-rect btn-grad btn-warning btn-sm" <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> οnclick="window.location.href='xunwu_add.jsp'">添加</button>
                <td>${vo.xunwuAddress}</td>
                <td>${vo.xunwuType}</td>
                <td>${vo.xunwuXunwuren}</td>
                <td>${vo.xunwuPhone}</td>
                <td title="${vo.xunwuText}">
                <c:choose>
                    <c:when test="${fn:length(vo.xunwuText) > 19}">
                        <c:out value="${fn:substring(vo.xunwuText, 0, 19)}..."/>
                    </c:when>
                    <c:otherwise>
                        <c:out value="${vo.xunwuText}"/>
                    </c:otherwise>
                </c:choose>
                </td>
                <td>
                    <button class="btn btn-rect btn-grad btn-warning btn-sm" style="padding: 0px 1px;" onclick="window.location.href='XunwuServlet?action=get&id=${vo.id}'">详情</button>&nbsp;
</script>
</html>

<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>修改寻物</title>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<jsp:include page="menu.jsp"/>
                <td width="12%">类型:</td>
                <td>
                        <input name="zhaolinType" type="radio" value="卡券" checked="checked"/>&nbsp;&nbsp;&nbsp;卡券&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="zhaolinType" type="radio" value="书箱"/>&nbsp;&nbsp;&nbsp;书箱&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="zhaolinType" type="radio" value="衣物"/>&nbsp;&nbsp;&nbsp;衣物&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="zhaolinType" type="radio" value="电子数码"/>&nbsp;&nbsp;&nbsp;电子数码&nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="zhaolinType" type="radio" value="其它"/>&nbsp;&nbsp;&nbsp;其它&nbsp;&nbsp;&nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td width="12%">暂存地点:</td><td><input class="index-content-table-td-add" type="text" id="zhaolinZhancun" name="zhaolinZhancun" value=""/></td>
            </tr>
            <tr>
                <td width="12%">联系人:</td><td><input class="index-content-table-td-add" type="text" id="zhaolinRen" name="zhaolinRen" value=""/></td>
            </tr>
            <tr>
                <td width="12%">联系方式:</td><td><input class="index-content-table-td-add" type="text" id="zhaolinPhone" name="zhaolinPhone" value=""/></td>
            </tr>
            <tr>
                    <td width="12%">备注:</td><td><textarea id="zhaolinText" name="zhaolinText" style="width: 60%; height: 100px;padding: 0px 17px;" placeholder="请输入内容......"></textarea></td>
    </div>
    <br>
    <table class="table table-striped table-hover table-bordered">
        <thead>
        <tr class="index-content-table-th">
            <th>物品名称</th>
            <th>丢失时间</th>
            <th>丢失地点</th>
            <th>类型</th>
            <th>遗失人</th>
            <th>联系方式</th>
            <th>备注</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${list}" var="vo">
            <tr class="index-content-table-td">
                <td>${vo.xunwuName}</td>
            <tr>
                <td width="12%">类型:</td>
                <td>
                   <input name="xunwuType" type="radio" value="卡券" ${vo.xunwuType=='卡券'?'checked':''}/>&nbsp;&nbsp;&nbsp;卡券&nbsp;&nbsp;&nbsp;&nbsp;
                   <input name="xunwuType" type="radio" value="书箱" ${vo.xunwuType=='书箱'?'checked':''}/>&nbsp;&nbsp;&nbsp;书箱&nbsp;&nbsp;&nbsp;&nbsp;
                   <input name="xunwuType" type="radio" value="衣物" ${vo.xunwuType=='衣物'?'checked':''}/>&nbsp;&nbsp;&nbsp;衣物&nbsp;&nbsp;&nbsp;&nbsp;
                   <input name="xunwuType" type="radio" value="电子数码" ${vo.xunwuType=='电子数码'?'checked':''}/>&nbsp;&nbsp;&nbsp;电子数码&nbsp;&nbsp;&nbsp;&nbsp;
                   <input name="xunwuType" type="radio" value="其它" ${vo.xunwuType=='其它'?'checked':''}/>&nbsp;&nbsp;&nbsp;其它&nbsp;&nbsp;&nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td width="12%">遗失人:</td><td><input class="index-content-table-td-add" type="text" id="xunwuXunwuren" name="xunwuXunwuren" value="${vo.xunwuXunwuren}"/></td>
            </tr>
            <tr>
                <td width="12%">联系方式:</td><td><input class="index-content-table-td-add" type="text" id="xunwuPhone" name="xunwuPhone" value="${vo.xunwuPhone}"/></td>
            </tr>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>寻物管理</title>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>招领详情</title>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<jsp:include page="menu.jsp"/>
<div class="index-content">
    <div class="index-content-operation">
        <a class="info-detail">招领详情</a>
        <br>
        <br>
    </div>
    <br>
    <form>
        </table>
        <br>
        <br>
        <br>
        &nbsp;&nbsp;&nbsp;<button type="submit" class="btn btn-rect btn-grad btn-warning btn-sm">提交</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" class="btn btn-rect btn-grad btn-warning btn-sm" onclick="javascript:history.back(-1);">取消</button>
    </form>
</div>

</body>
<script type="text/javascript">
    //提交之前进行检查,如果return false,则不允许提交
    function check() {
        //根据ID获取值
        if (document.getElementById("zhaolinName").value.trim().length == 0) {
            alert("物品名称不能为空!");
            return false;
        }

Java代码:略

运行环境

Java≥6、Tomcat≥7.0、MySQL≥5.5

开发工具

idea/eclipse/MyEclipse

技术框架

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap.

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

开发工具:idea或eclipse或myeclipse

适用

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

功能说明

登录、注册、退出、用户模块、公告模块、招领模块、寻物模块的增删改查管理

v.mp4_20211009_213559.126

v.mp4_20211009_213602.871

v.mp4_20211009_213609.470

v.mp4_20211009_213613.655

v.mp4_20211009_213625.838

v.mp4_20211009_213629.134

v.mp4_20211009_213631.615

v.mp4_20211009_213635.462

v.mp4_20211009_213641.046

v.mp4_20211009_213644.919

v.mp4_20211009_213652.238

v.mp4_20211009_213701.815

v.mp4_20211009_213712.574

document

←源码获取方式见左侧[源码QQ]

这篇关于基于javaweb+jsp的校园失物招领管理系统的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!