📄 veditadmin.jsp
字号:
<%@ page pageEncoding="GB2312"%>
<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ include file="ispass.jsp" %>
<fmt:requestEncoding value="gb2312" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改管理员密码</title>
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<c:set var="urls" value="<%=request.getHeader("Referer")%>" />
<c:catch var="isok">
<c:set var="isAdd" value="true" />
<%--检测ID是否是整数--%>
<jsp:useBean id="isinto" class="yy.intBean"/>
<jsp:setProperty name="isinto" property="streger" value="${param.adminuserId}" />
<c:if test="${isinto.integer == false}">
<c:set var="errorMsg" scope="request" value="参数错误" />
<c:set var="errorUrl" scope="request" value="${param.url}" />
<jsp:forward page="error.jsp" />
</c:if>
<%--检测相关参数是否正确--%>
<c:if test="${empty fn:trim(param.password)}">
<c:set var="passError" scope="request" value="请填写密码" />
<c:set var="isAdd" value="false" />
</c:if>
<c:if test="${empty fn:trim(param.password2)}">
<c:set var="pass2Error" scope="request" value="请填写确认密码" />
<c:set var="isAdd" value="false" />
</c:if>
<c:if test="${param.password != param.password2}">
<c:set var="passError" scope="request" value="二次填写的密码不一样" />
<c:set var="isAdd" value="false" />
</c:if>
<%-- 检测是否有通过,否则重定向 --%>
<c:choose>
<c:when test="${isAdd}">
<%-- 密码MD5加密 --%>
<jsp:useBean id="oMD5" scope="request" class="beartool.MD5"/>
<c:set value="${param.password}" var="password" />
<jsp:useBean id="password" type="java.lang.String" />
<%-- 更新数据库 --%>
<sql:update>
update flashAdmin Set adminPass = ? where id = ?
<sql:param value="<%=oMD5.getMD5ofStr(password)%>" />
<sql:param value="${param.adminuserId}" />
</sql:update>
<%-- 定向到另一页面 --%>
<c:set var="errorMsg" scope="request" value="管理员密码更新成功" />
<jsp:forward page="${param.url}" />
</c:when>
<c:otherwise>
<jsp:forward page="${param.url}" />
</c:otherwise>
</c:choose>
</c:catch>
<c:if test="${!empty isok}">
<c:set var="errorMsg" scope="request" value="对不起参数提交错误,请返回另行操作!" />
<c:set var="errorUrl" scope="request" value="${urls}" />
<jsp:forward page="error.jsp" />
</c:if>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -