基于javaweb+jsp的学生档案管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">增加社会关系</h4>
</div>
<div class="modal-body">
<div class="form-group hidden">
<label class="control-label">(hidden)</label>
<input type="text" class="form-control" name="action" value="add">
</div>
<div class="form-group">
<label for="add-guanxiName" class="control-label">学生姓名:</label>
<input type="text" class="form-control" name="guanxiName" id="add-guanxiName">
</div>
<div class="form-group">
<label for="add-guanxiNo" class="control-label">学号:</label>
<input type="text" class="form-control" name="guanxiNo" id="add-guanxiNo">
</div>
<div class="form-group">
alert("生日不能为空");
return false;
}
if (document.getElementById("edit-studentHometown").value.trim().length == 0) {
alert("籍贯不能为空");
return false;
}
if (document.getElementById("edit-studentPhone").value.trim().length == 0) {
alert("联系方式不能为空");
return false;
}
if (document.getElementById("edit-studentMajor").value.trim().length == 0) {
alert("专业不能为空");
<h4 class="modal-title">删除公告</h4>
</div>
<div class="modal-body">
确认要删除该公告记录吗?
<div class="form-group hidden">
<label class="control-label">(hidden)</label>
<input type="hidden" class="form-control" name="action" value="delete">
<input type="text" class="form-control" name="id" id="delete-id">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-rect btn-grad btn-warning" data-dismiss="modal">取消</button>
<button type="submit" class="btn btn-rect btn-grad btn-info">删除</button>
</div>
</form>
</div>
</div>
</div>
</body>
<script>
$('#modal-delete').on('show.bs.modal', function (event) {
let button = $(event.relatedTarget);
let id = button.data('id');
let modal = $(this);
modal.find('#delete-id').val(id);
})
<td>${vo.studentName}</td>
<td>${vo.studentSex}</td>
<td>${vo.studentBirthday}</td>
<td>${vo.studentHometown}</td>
<td>${vo.studentPhone}</td>
<td>${vo.studentMajor}</td>
<td>${vo.studentClass}</td>
<td title="${vo.studentText}">
<c:choose>
<c:when test="${fn:length(vo.studentText) > 19}">
<c:out value="${fn:substring(vo.studentText, 0, 19)}..."/>
</c:when>
<c:otherwise>
<c:out value="${vo.studentText}"/>
</c:otherwise>
</c:choose>
</td>
<th style="text-align: center;">
<button class="btn btn-rect btn-grad btn-danger btn-sm" data-id="${vo.id}"
data-toggle="modal" data-target="#modal-info">详情
</button>
<button class="btn btn-rect btn-grad btn-danger btn-sm"
<c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if>
data-id="${vo.id}"
data-toggle="modal" data-target="#modal-edit">编辑
</button>
ImageIO.write(image, "JPEG", os);// 以JPEG格式向客户端发送图形验证码
}
@RequestMapping("authResetPassword")
public void resetPassword(HttpServletResponse response, HttpServletRequest request) throws IOException, ServletException {
String msg;
User loginUser = (User) request.getSession().getAttribute("loginUser");
String oldPassword = Util.decode(request, "oldPassword");
if (!loginUser.getPassword().equals(oldPassword)) {
msg = "原密码错误!";
} else {
String newPassword = Util.decode(request, "newPassword");
loginUser.setPassword(newPassword);
this.userService.update(loginUser);
msg = "修改成功!";
}
request.getSession().setAttribute("alert_msg", msg);
request.getRequestDispatcher("reset_password.jsp").forward(request, response);
//根据ID获取值
if (document.getElementById("add-studentNo").value.trim().length == 0) {
alert("学号不能为空");
return false;
}
if (document.getElementById("add-studentName").value.trim().length == 0) {
alert("姓名不能为空");
return false;
}
if (document.getElementById("add-studentBirthday").value.trim().length == 0) {
alert("生日不能为空");
return false;
}
if (document.getElementById("add-studentHometown").value.trim().length == 0) {
alert("籍贯不能为空");
return false;
}
if (document.getElementById("add-studentPhone").value.trim().length == 0) {
alert("联系方式不能为空");
return false;
}
if (document.getElementById("add-studentMajor").value.trim().length == 0) {
alert("专业不能为空");
return false;
}
if (document.getElementById("add-studentClass").value.trim().length == 0) {
alert("班级不能为空");
/**
* 删除用户
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("userDelete")
public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
Serializable id = Util.decode(request, "id");
userService.delete(Arrays.asList(id));
this.redirectList(request, response);
}
/**
* 编辑用户
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("userEdit")
public void edit(HttpServletResponse response, HttpServletRequest request) throws IOException {
User vo = new User();
vo.setId(Long.valueOf(Util.decode(request, "id")));
return guanxiText;
}
public void setGuanxiText(String guanxiText) {
this.guanxiText = guanxiText;
}
}
package com.demo.util;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* 拦截器
*/
public class LoginInterceptor implements HandlerInterceptor {
<td style="width: 15%;">专业:</td>
<td><b id="info-studentMajor"></b></td>
</tr>
<tr>
<td style="width: 15%;">班级:</td>
<td><b id="info-studentClass"></b></td>
</tr>
<tr>
<td style="width: 15%;">备注:</td>
<td><b id="info-studentText"></b></td>
</tr>
</table>
<br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-rect btn-grad btn-warning" data-dismiss="modal">关闭</button>
</div>
</form>
</div>
</div>
</div>
}
if (document.getElementById("add-guanxiDanwei").value.trim().length == 0) {
alert("工作单位不能为空");
return false;
}
if (document.getElementById("add-guanxiZhiwei").value.trim().length == 0) {
alert("职位不能为空");
return false;
}
if (document.getElementById("add-guanxiZhengzhi").value.trim().length == 0) {
alert("政治面貌不能为空");
return false;
}
if (document.getElementById("add-guanxiPhone").value.trim().length == 0) {
alert("联系方式不能为空");
return false;
}
return true;
}
//编辑表单提交之前进行检查,如果return false,则不允许提交
function editCheck() {
//根据ID获取值
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、学籍模块、社会关系模块的增删改查管理