下面是代码
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="./CSS/changekey.css" />
<script type="text/javascript" src="./Script/changekey.js"></script>
<jsp:useBean id="account" class="beans.Account" scope="session"></jsp:useBean>
<jsp:useBean id="changekey" class="beans.ChangeKey" scope="page"></jsp:useBean>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form id="changekey" name="changekey" method="post" action="#" onsubmit="return changekey()">
<table>
<tr>
<td>输入旧密码:</td><td><input class="put" type="password" id="oldk" name="oldk" /> </td>
</tr>
<tr>
<td>请输入新密码:</td><td><input class="put" type="password" id="new1" name="new1" /></td>
</tr>
<tr>
<td>再一次输入新密码:</td><td><input class="put" type="password" id="new2" name="new2" /></td>
</tr>
<tr>
<td></td><td><input class="put" type="submit" id="new3" name="new3" /></td>
</tr>
</table>
</form>
<%
changekey.setId(account.getID());
if(changekey.setOld(request.getParameter("oldk"))){ //在这一行的时候怎么让他等form、的表单提交了之后再执行?是可以用servlet解决,但是这里在jsp页面加载的时候就执行了,返回的表单内容是null,如何等提交后再执行?
changekey.setNewkey(request.getParameter("new1"));
}else {
out.println("原始密码错误!");
}
%>
</body>
</html>
if(changekey.setOld(request.getParameter("oldk"))){ //在这一行的时候怎么让他等form、的表单提交了之后再执行?是可以用servlet解决,但是这里在jsp页面加载的时候就执行了,返回的表单内容是null,如何等提交后再执行?
拉莫斯之舞
相关分类