基于javaweb+jsp的机房设备管理系统
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript idea eclipse MyEclipse Servlet SSM Maven …
部分代码实现JSP
<table class="index-content-table-add">
<tr>
<td width="12%">机房号:</td><td><input class="index-content-table-td-add" type="text" id="jifangName" name="jifangName" value=""/></td>
</tr>
<tr>
<td width="12%">容纳人数:</td><td><input class="index-content-table-td-add" type="text" id="jifangCount" name="jifangCount" value=""/></td>
</tr>
<tr>
<td width="12%">介绍:</td><td><input class="index-content-table-td-add" type="text" id="jifangJieshao" name="jifangJieshao" value=""/></td>
</tr>
<tr>
<td width="12%">状态:</td>
<td>
<br>
</div>
<br>
<div class="index-content-operation">
<button class="btn btn-line btn-rect btn-success btn-sm" <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> οnclick="window.location.href='jifang_add.jsp'">添加</button>
<div class="index-content-operation-search"><input id="search_keyword" placeholder="机房号" type="text" name="search_keyword"/><input type="hidden" id="searchColumn" name="searchColumn" value="jifang_name"/><button class="btn btn-line btn-rect btn-success btn-sm" onclick="searchList()">搜索</button></div>
</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>
</tr>
</thead>
<tbody>
<c:forEach items="${list}" var="vo">
<%@ 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"/>
<div class="index-content">
<div class="index-content-operation">
<a class="info-detail">修改机房</a>
<br>
if (document.getElementById("jifangJieshao").value.trim().length == 0) {
alert("介绍不能为空!");
return false;
}
return true;
}
</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>
<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 class="index-content-table-add" style="font-size: 18px;">
<tr>
<td>机房号:<b>${vo.jifangName}</b></td>
</tr>
<tr>
<td>容纳人数:<b>${vo.jifangCount}</b></td>
function searchList() {
window.location.href = "JifangServlet?action=list&searchColumn="+document.getElementById("searchColumn").value+"&keyword=" + document.getElementById("search_keyword").value;
}
</script>
<input name="jifangStatus" type="radio" value="使用中"/> 使用中
<input name="jifangStatus" type="radio" value="暂停使用"/> 暂停使用
</td>
</tr>
<tr>
<td width="12%">备注:</td><td><textarea id="jifangText" name="jifangText" style="width: 60%; height: 100px;padding: 0px 17px;" placeholder="请输入内容......"></textarea></td>
</tr>
</table>
<br>
<br>
<br>
<button type="submit" class="btn btn-line btn-rect btn-success btn-sm">提交</button> <button type="button" class="btn btn-line btn-rect btn-primary btn-sm" onclick="javascript:history.back(-1);">取消</button>
</form>
</div>
</body>
<script type="text/javascript">
//提交之前进行检查,如果return false,则不允许提交
function check() {
<br>
<br>
<br>
<button type="submit" class="btn btn-line btn-rect btn-success btn-sm">提交</button> <button type="button" class="btn btn-line btn-rect btn-primary btn-sm" onclick="javascript:history.back(-1);">取消</button>
</form>
</div>
</body>
<script type="text/javascript">
//提交之前进行检查,如果return false,则不允许提交
function check() {
//根据ID获取值
if (document.getElementById("jifangName").value.trim().length == 0) {
alert("机房号不能为空!");
return false;
}
if (document.getElementById("jifangCount").value.trim().length == 0) {
alert("容纳人数不能为空!");
return false;
<td>${vo.jifangName}</td>
<td>${vo.jifangCount}</td>
<td>${vo.jifangJieshao}</td>
<td>${vo.jifangStatus}</td>
<td>
<button class="btn btn-line btn-rect btn-primary btn-sm" style="padding: 0px 1px;" onclick="window.location.href='JifangServlet?action=get&id=${vo.id}'">详情</button>
<button class="btn btn-line btn-rect btn-danger btn-sm" style="padding: 0px 1px;"
<c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if>
οnclick="window.location.href='JifangServlet?action=editPre&id=${vo.id}'">编辑</button>
<button class="btn btn-line btn-rect btn-danger btn-sm" style="padding: 0px 1px;" <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> οnclick="if(window.confirm('将要删除:${vo.jifangName}?'))window.location.href='JifangServlet?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>
<%@ 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>
<tr>
<td>介绍:<b>${vo.jifangJieshao}</b></td>
</tr>
<tr>
<td>状态:
<b>${vo.jifangStatus}</b>
</td>
</tr>
<tr>
<td>备注:<b>${vo.jifangText}</b></td>
</tr>
</table>
<br>
<button type="button" class="btn btn-line btn-rect btn-primary btn-sm" onclick="javascript:history.back(-1);">返回</button>
</form>
</div>
</body>
</html>
</div>
<br>
<form action="JifangServlet?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="jifangName" name="jifangName" value="${vo.jifangName}"/></td>
</tr>
<tr>
<td width="12%">容纳人数:</td><td><input class="index-content-table-td-add" type="text" id="jifangCount" name="jifangCount" value="${vo.jifangCount}"/></td>
</tr>
<tr>
</tr>
<tr>
<td width="12%">状态:</td>
<td>
<input name="jifangStatus" type="radio" value="空闲" ${vo.jifangStatus=='空闲'?'checked':''}/> 空闲
<input name="jifangStatus" type="radio" value="使用中" ${vo.jifangStatus=='使用中'?'checked':''}/> 使用中
<input name="jifangStatus" type="radio" value="暂停使用" ${vo.jifangStatus=='暂停使用'?'checked':''}/> 暂停使用
</td>
</tr>
<tr>
<td width="12%">备注:</td><td><textarea id="jifangText" name="jifangText" style="width: 60%; height: 100px;padding: 0px 17px;" placeholder="请输入内容......">${vo.jifangText}</textarea></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>
<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>
if (document.getElementById("jifangName").value.trim().length == 0) {
alert("机房号不能为空!");
return false;
}
if (document.getElementById("jifangCount").value.trim().length == 0) {
alert("容纳人数不能为空!");
return false;
}
if (document.getElementById("jifangJieshao").value.trim().length == 0) {
alert("介绍不能为空!");
return false;
}
return true;
}
</script>
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
idea/eclipse/MyEclipse
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript idea eclipse MyEclipse Servlet SSM Maven …
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、老师模块、机房模块、设备模块的增删改查管理