各位大神帮忙看看,我刷新页面是要原来都是空的页面,不需要为空的判断
<form action="${pageContext.request.contextPath}/RegisterServlet" method="post">
<h3 align="center">注册</h3>
<table width=40% border="1" align="center">
<tr>
<td width="20%">用户名 </td>
<td>
<input type="text" name="username" value="${formbean.username}" style="width: 30%">${formbean.errors.username}
</td>
</tr>
<tr>
<td width="20%">密码</td>
<td>
<input type="password" name="password" value="${formbean.password}" style="width: 30%">${formbean.errors.password}
</td>
</tr>
-------------------------------------------------------------------------
if(this.username == null || this.username.trim().equals("")) {
isOk = false;
errors.put("username","用户名不能为空");
}else {
if(!this.username.matches("[a-zA-Z]{3,8}")) {
isOk = false;
errors.put("username","用户名必须为3~8个字符");
}
}
<form action="${pageContext.request.contextPath}/RegisterServlet" method="post">
<h3 align="center">注册</h3>
<table width=40% border="1" align="center">
<tr>
<td width="20%">用户名 </td>
<td>
<input type="text" name="username" value="${formbean.username}" style="width: 30%">${formbean.errors.username}
</td>
</tr>
<tr>
<td width="20%">密码</td>
<td>
<input type="password" name="password" value="${formbean.password}" style="width: 30%">${formbean.errors.password}
</td>
</tr>
-------------------------------------------------------------------------
if(this.username == null || this.username.trim().equals("")) {
isOk = false;
errors.put("username","用户名不能为空");
}else {
if(!this.username.matches("[a-zA-Z]{3,8}")) {
isOk = false;
errors.put("username","用户名必须为3~8个字符");
}
}
$(function(){
if(error != null || error != ''){
error.remove();
}
});