You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
text1/web/WEB-INF/student/studentUpdatePassword.jsp

115 lines
12 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!-- 以上两行是JSP页面相关指令
第一行用于设置该JSP页面的内容类型为text/html即HTML格式页面指定字符编码为UTF-8同时表明页面使用Java语言来处理相关逻辑。
第二行引入了JSTLJavaServer Pages Standard Tag Library核心标签库定义前缀为“c”后续就能通过这个前缀使用JSTL提供的各类标签例如用于循环遍历、条件判断等操作的标签方便在JSP页面中处理动态数据 -->
<html>
<head>
<title>修改密码</title>
<!-- 设置当前HTML页面的标题为“修改密码”该标题会显示在浏览器的标题栏中让用户明确此页面的主要功能 -->
<link rel="stylesheet" href="./css/layui.css">
<!-- 引入layui框架的样式表文件通过相对路径从当前页面所在目录下的css文件夹中查找应用layui框架提供的样式用于页面布局、组件美化等操作使页面呈现layui框架定义的外观风格 -->
<link rel="stylesheet" href="./css/style.css">
<!-- 引入自定义的样式表文件style.css同样采用相对路径引用用于添加符合特定需求的个性化页面样式对页面显示效果做进一步定制 -->
<script src="./layui.js"></script>
<!-- 引入layui框架的JavaScript脚本文件从当前页面所在目录获取该文件layui脚本为页面提供众多交互功能以及各种组件支持例如实现菜单交互、页面元素动态展示等功能 -->
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<!-- 从CDN内容分发网络引入jQuery库的最小化版本jQuery是常用的JavaScript库能简化页面中对DOM元素的操作、事件处理以及实现各种动画效果等方便开发人员编写JavaScript代码来实现页面交互逻辑 -->
</head>
<body class="layui-layout-body" style="background-color: #F2F2F2">
<!-- 为页面主体body设置类名“layui-layout-body”同时将背景颜色设定为浅灰色#F2F2F2这里的类名通常与layui框架的布局样式相关联按照其框架规范来构建页面整体外观 -->
<jsp:include page="/filterLogin.jsp"></jsp:include>
<!-- 通过JSP的include指令包含名为filterLogin.jsp的页面内容通常这个页面用于处理用户登录相关的验证逻辑或者展示登录相关的界面元素比如登录表单等以此确保只有登录后的用户可访问后续页面内容 -->
<jsp:include page="/WEB-INF/student/sHeader.jsp"></jsp:include>
<!-- 包含位于WEB-INF/student目录下的sHeader.jsp页面一般用于构建页面的头部区域可能包含如网站logo、导航栏等常见的头部元素起到统一页面头部布局的作用 -->
<jsp:include page="/WEB-INF/student/studentNav.jsp"></jsp:include>
<!-- 再次使用JSP的include指令包含WEB-INF/student目录下的studentNav.jsp页面通常用来展示学生端特有的导航菜单内容便于用户在不同功能模块之间进行切换操作 -->
<div class="layui-layout layui-layout-admin">
<!-- 创建一个div元素并赋予其两个类名“layui-layout”和“layui-layout-admin”这一般是layui框架中用于定义页面整体布局结构的特定类名遵循layui框架的布局规范来划分页面不同区域例如头部、主体、侧边栏等具体根据框架设定 -->
<div class="layui-body">
<!-- 在上述布局div内部再创建一个div元素类名为“layui-body”在layui框架里这个区域通常用于承载页面的主要内容例如展示各种业务数据、操作按钮等内容 -->
<!-- 内容主体区域 -->
<div style="padding: 15px;">
<!-- 新建一个div元素并通过内联样式设置其四周内边距为15px这样做主要是为了对内部元素进行一定的排版让页面内容看起来更加规整避免显得过于紧凑或者松散 -->
<span class="layui-breadcrumb">
<a href="">学生端</a>
<a href="">个人信息管理</a>
<a><cite>修改密码</cite></a>
</span>
<!-- 创建一个layui框架的面包屑导航组件通过一系列超链接a标签展示当前页面在整个系统中的层级路径这里展示了从“学生端”进入“个人信息管理”再到“修改密码”页面但超链接的href属性目前为空可能后续需要完善具体的跳转地址以实现页面导航功能 -->
<form class="layui-form" action="${pageContext.request.contextPath}/studentPasswordUpdateServlet" style="padding-top: 50px" method="post">
<!-- 创建一个layui框架的表单form设置其提交的目标地址为名为studentPasswordUpdateServlet的Servlet通过EL表达式动态获取上下文路径拼接而成通过内联样式设置顶部内边距为50px提交方式为POST用于收集用户输入的修改密码相关信息并提交给后端进行密码更新操作 -->
<div class="layui-form-item">
<!-- 创建一个layui框架下表单项目form-item的div容器layui框架通常会依据这个结构来对内部的表单元素进行布局和样式处理 -->
<label class="layui-form-label">学号</label>
<!-- 创建一个表单标签label元素用于标识后面的输入框对应的含义这里显示为“学号” -->
<div class="layui-input-block">
<!-- 创建一个用于放置输入框的div容器在layui框架的表单布局里控制输入框的显示样式 -->
<input type="text" name="title" value="${student.s_id}" required readonly="readonly" lay-verify="required" autocomplete="off" class="layui-input">
<!-- 创建一个文本输入框input元素类型为文本type: text名称为“title”其值通过EL表达式从名为“student”的对象中获取可能是从后台查询出当前登录学生的学号信息进行回显设置为必填项required同时设置为只读readonly="readonly"通过layui框架的验证机制lay-verify="required"来确保用户不能留空关闭自动完成功能autocomplete="off"并应用layui框架的输入框样式类layui-input -->
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">当前密码</label>
<div class="layui-input-block">
<input type="text" name="student-password" id="student-password" value="${student.s_password}" readonly="readonly" placeholder="" autocomplete="off" class="layui-input">
<!-- 创建一个文本输入框类型为文本名称为“student-password”设置了id为“student-password”方便后续通过JavaScript操作该元素输入框的值通过EL表达式获取当前学生的密码信息进行回显设置为只读关闭自动完成功能应用layui框架输入框样式这里用于展示当前密码但不允许用户修改 -->
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">新密码</label>
<div class="layui-input-block">
<input type="password" name="student-newpassword" id="student-newpassword" value="" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
<!-- 创建一个密码输入框input类型为password名称为“student-newpassword”设置了id为“student-newpassword”初始值为空设置为必填项且通过layui框架验证机制确保必填关闭自动完成功能用于让用户输入新的密码信息 -->
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">确认密码</label>
<div class="layui-input-block">
<input type="password" name="student-ennewpassword" id="student-ennewpassword" value="" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
<!-- 创建一个密码输入框名称为“student-ennewpassword”id为“student-ennewpassword”初始值为空通过layui框架验证机制确保必填用于让用户再次输入密码进行确认确保两次输入的新密码一致 -->
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="formDemo">修改</button>
<!-- 创建一个提交按钮button应用layui框架的按钮样式类layui-btn设置其为可提交表单lay-submit并通过lay-filter属性设置一个名为“formDemo”的过滤器点击该按钮会触发表单提交操作将用户输入的新密码等信息发送到指定的Servlet -->
<span style="padding-left: 20px;">${update_msg}</span>
<!-- 通过EL表达式显示名为“update_msg”的变量的值可能用于在页面上显示一些与密码更新操作相关的提示信息比如更新成功或失败的消息等 -->
</div>
</div>
</form>
<jsp:include page="/footer.jsp"></jsp:include>
<!-- 包含名为footer.jsp的页面一般用于展示页面底部的一些通用信息比如版权声明、网站相关链接、联系方式等内容 -->
</div>
</div>
</div>
<script type="text/javascript">
$("#nav li:nth-child(5) dl dd:nth-child(2)").addClass("layui-this");
// 使用jQuery选择器选中页面中id为“nav”的元素下的第5个子元素li下的dl元素下的第2个dd元素并为其添加类名“layui-this”在layui框架中添加这个类名通常意味着将对应的导航菜单项标记为当前选中状态使其呈现特定的样式例如改变颜色、加粗等以此表明当前所在的页面功能模块对应的菜单选项
$("#nav li:nth-child(5)").addClass("layui-nav-itemed");
// 同样使用jQuery选择器选中页面中id为“nav”的元素下的第5个子元素li并为其添加类名“layui-nav-itemed”在layui框架里这个类名可能用于控制导航菜单的展开或折叠状态使得对应的菜单层级结构展示相应的效果方便用户查看相关子菜单 -->
</script>
<script>
//JavaScript代码区域
layui.use('element', function(){
var element = layui.element;
element.init();
// 使用layui框架的element模块调用其init方法进行初始化操作。在layui框架中element模块提供了很多页面元素交互相关的功能例如实现页面布局的动态切换、菜单的展开收起等交互效果通过调用init方法可以激活这些功能确保页面上基于element模块构建的各种UI组件能够正常工作
});
</script>
<script>
//Demo
layui.use('form', function(){
// 使用layui框架的form模块后续可以在这个回调函数内部编写与表单相关的交互逻辑代码不过目前这里没有具体内容可能是预留的用于进一步开发表单验证、提交等相关功能的地方
});
</script>
</body>
</html>