%>
<tr>
<td> <div align="center">客户:</div></td>
<td> <div align="center"><input name="user_name" type="text" class=input id="user_name" style="FONT-SIZE: 12px; WIDTH: 110px" size="10" maxlength="18"></div></td>
</tr>
<tr>
<td> <div align="center">密码:</div></td>
<td> <div align="center"><input style="FONT-SIZE: 12px; WIDTH: 110px" type="password" name="user_pass" size="10" class=input maxlength="18"></div></td>
</tr>
<tr>
<td colspan="2" nowrap><div align="center"><input type="submit" name="Submit2" value="登录"><input type="button" name="Submit" value="用户注册" onClick="javascript:window.location.href='reguser.jsp'"></div></td>
</tr>
<%
}
上面代码显示用户未登录信息框。如果用户没有登录,则显示输入“客户”和“密码”文本框。并显示“登录”和“用户注册”按钮。当用户输入用户名及密码后,单击【登录】按钮将login.jsp页面进行判断用户信息。若用户还没有注册,可单击【用户注册】按钮链接reguser.jsp页面进行注册。
//判断登录结束
String loginout=request.getParameter("loginout");//退出登陆
if(loginout!=null)
{
if(loginout.compareTo("true")==0)
{
session.removeAttribute("user_name");
response.sendRedirect("index.jsp");
}