基于javaweb+jsp的校园失物招领管理系统
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript idea eclipse MyEclipse Servlet SSM Maven …
部分代码实现JSP
} </script> </html> <%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>寻物编辑</title> <%@ include file="include/head.jsp" %> </head> <body> <div class="container-fluid"> <ul class="nav nav-tabs"> <li><a href="xunwuList">寻物列表</a></li> <li class="active"><a href="#">编辑</a></li> </ul> <br/> <form class="form-horizontal" role="form" action="xunwuEdit" method="post" onsubmit="return check()"> <input type="hidden" class="form-control" id="id" name="id" value="${vo.id}"/>
</div> <div class="form-group"> <label class="col-sm-3 control-label">遗失人:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="xunwuXunwuren" name="xunwuXunwuren"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">联系方式:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="xunwuPhone" name="xunwuPhone"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">备注:</label> <div class="col-sm-5"> <textarea rows="3" class="form-control" id="xunwuText" name="xunwuText" placeholder="请输入内容......"></textarea> </div> </div> <div class="form-group">
alert("物品名称不能为空!"); return false; } if (document.getElementById("xunwuDate").value.trim().length == 0) { alert("丢失时间不能为空!"); return false; } 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; }
</form> <br/> <table class="table table-hover table-bordered"> <thead> <tr> <th>物品名称</th> <th>丢失时间</th> <th>丢失地点</th> <th>类型</th> <th>遗失人</th> <th>联系方式</th> <th>操作</th> </tr> </thead> <tbody> <c:forEach items="${list}" var="vo"> <tr> <td><a href="xunwuGet?id=${vo.id}">${vo.xunwuName}</a></td> <td>${vo.xunwuDate}</td>
</div> </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("丢失时间不能为空!"); return false; }
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>寻物添加</title> <%@ include file="include/head.jsp" %> </head> <body> <div class="container-fluid"> <ul class="nav nav-tabs"> <li><a href="xunwuList?">寻物列表</a></li> <li class="active"><a href="#">添加</a></li> </ul> <br/> <form class="form-horizontal" role="form" action="xunwuAdd" method="post" onsubmit="return check()">
删除 </button> </td> </tr> </c:forEach> </tbody> </table> <div style="float: right;padding-right: 10px;color: #515151;"><jsp:include page="split.jsp"/></div> </div> </body>
</div> </div> <div class="form-group"> <label class="col-sm-3 control-label">遗失人:</label> <div class="col-sm-5" style="padding-top: 7px;"> ${vo.xunwuXunwuren} </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">联系方式:</label> <div class="col-sm-5" style="padding-top: 7px;"> ${vo.xunwuPhone} </div>
<td>${vo.xunwuType}</td> <td>${vo.xunwuXunwuren}</td> <td>${vo.xunwuPhone}</td> <td> <button onclick="window.location.href='xunwuEditPre?id=${vo.id}'" class="btn btn-pill btn-line btn-info btn-xs" <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> > <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> 编辑 </button> <button onclick="if(window.confirm('将要删除:${vo.xunwuName}?'))window.location.href='xunwuDelete?id=${vo.id}'" class="btn btn-pill btn-line btn-danger btn-xs" <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> >
<label class="col-sm-3 control-label">丢失时间:</label> <div class="col-sm-5" style="padding-top: 7px;"> ${vo.xunwuDate} </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">丢失地点:</label> <div class="col-sm-5" style="padding-top: 7px;"> ${vo.xunwuAddress} </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">类型:</label> <div class="col-sm-5" style="padding-top: 7px;">
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>寻物管理</title> <%@ include file="include/head.jsp" %> </head> <body> <div class="container-fluid"> <ul class="nav nav-tabs"> <li class="active"><a href="xunwuList">寻物列表</a></li> <c:if test="${loginUser.userType == '管理员'}"><li><a href="xunwu_add.jsp">添加</a></li></c:if> </ul> <br/> <form class="form-inline" id="searchForm" action="xunwuList" method="post"> <div class="form-group"> <input type="text" class="form-control" name="keyword" id="keyword" placeholder="物品名称"> <input type="hidden" id="searchColumn" name="searchColumn" value="xunwu_name"/> </div> <button class="btn btn-pill btn-line btn-info btn-sm"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>查询
<div class="form-group"> <label class="col-sm-3 control-label">联系方式:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="xunwuPhone" name="xunwuPhone" value="${vo.xunwuPhone}"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">备注:</label> <div class="col-sm-5"> <textarea rows="3" class="form-control" id="xunwuText" name="xunwuText" placeholder="请输入内容......">${vo.xunwuText}</textarea> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"></label> <div class="col-sm-5"> <input type="submit" class="btn btn-pill btn-line btn-warning btn-sm" value="保存"> <input type="button" class="btn btn-pill btn-line btn-success btn-sm" value="返回" onclick="javascript:history.back(-1);">
<label class="col-sm-3 control-label">物品名称:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="xunwuName" name="xunwuName" value="${vo.xunwuName}"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">丢失时间:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="xunwuDate" name="xunwuDate" value="${vo.xunwuDate}"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">丢失地点:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="xunwuAddress" name="xunwuAddress" value="${vo.xunwuAddress}"> </div>
<div class="col-sm-5"> <input type="submit" class="btn btn-pill btn-line btn-warning btn-sm" value="保存"> <input type="button" class="btn btn-pill btn-line btn-success btn-sm" value="返回" onclick="javascript:history.back(-1);"> </div> </div> </form> </div> </body> <script type="text/javascript"> //提交之前进行检查,如果return false,则不允许提交 function check() { //根据ID获取值
<label class="col-sm-3 control-label">物品名称:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="xunwuName" name="xunwuName"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">丢失时间:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="xunwuDate" name="xunwuDate"> </div> </div> <div class="form-group">
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> </html> <%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<div class="col-sm-5"> <input type="text" class="form-control" id="xunwuAddress" name="xunwuAddress"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">类型:</label> <div class="col-sm-5"> <input name="xunwuType" type="radio" value="卡券" checked="checked"/> 卡券 <input name="xunwuType" type="radio" value="书箱"/> 书箱 <input name="xunwuType" type="radio" value="衣物"/> 衣物 <input name="xunwuType" type="radio" value="电子数码"/> 电子数码 <input name="xunwuType" type="radio" value="其它"/> 其它
<div class="form-group"> <label class="col-sm-3 control-label">备注:</label> <div class="col-sm-5" style="padding-top: 7px;"> <textarea rows="3" class="form-control" id="xunwuText" name="xunwuText" disabled="disabled">${vo.xunwuText}</textarea> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"></label> <div class="col-sm-5" style="padding-top: 7px;"> <input type="button" class="btn btn-pill btn-line btn-success btn-sm" value="返回" onclick="javascript:history.back(-1);"> </div> </div> </form> </div> </body> </html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>寻物详情</title> <%@ include file="include/head.jsp" %> </head> <body> <div class="container-fluid"> <ul class="nav nav-tabs"> <li><a href="xunwuList">用户列表</a></li> <li class="active"><a href="#">详情</a></li> </ul> <br/> <form class="form-horizontal" role="form" action="#" method="post"> <input type="hidden" class="form-control" id="id" name="id" value="${vo.id}"/> <div class="form-group"> <label class="col-sm-3 control-label">物品名称:</label> <div class="col-sm-5" style="padding-top: 7px;"> ${vo.xunwuName} </div> </div>
<div class="form-group"> <label class="col-sm-3 control-label">类型:</label> <div class="col-sm-5"> <input name="xunwuType" type="radio" value="卡券" ${vo.xunwuType=='卡券'?'checked':''}/> 卡券 <input name="xunwuType" type="radio" value="书箱" ${vo.xunwuType=='书箱'?'checked':''}/> 书箱 <input name="xunwuType" type="radio" value="衣物" ${vo.xunwuType=='衣物'?'checked':''}/> 衣物 <input name="xunwuType" type="radio" value="电子数码" ${vo.xunwuType=='电子数码'?'checked':''}/> 电子数码 <input name="xunwuType" type="radio" value="其它" ${vo.xunwuType=='其它'?'checked':''}/> 其它 </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">遗失人:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="xunwuXunwuren" name="xunwuXunwuren" value="${vo.xunwuXunwuren}"> </div>
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
idea/eclipse/MyEclipse
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript idea eclipse MyEclipse Servlet SSM Maven …
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、招领模块、寻物模块的增删改查管理