jsp在本页实现登陆
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'Shopping.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<table width="683" border="1">
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td width="166">
<form action="Admin.jsp" method="post">
姓名:<input type="text" name="username" width="100px"/>
密码:<input type="password" name="password" width="100px"/>
<input type="submit" name="ok" value="登入">
<input type="reset" value="重置">
</form> </td>
<td width="89"><img src="images/1.jpg" /></td>
<td width="96"><img src="images/2.jpg" /></td>
<td width="96"><img src="images/3.jpg" /></td>
<td width="202"> </td>
</tr>
<tr>
<td width="166"></td>
<td>
<input type="checkbox" name="inst" value="女士上衣">女式上衣 </td>
<td> <input type="checkbox" name="inst" value="男士上衣">男士上衣</td>
<td> <input type="checkbox" name="inst" value="男鞋">男鞋</td>
<td> </td>
</tr>
<tr>
<td width="166"></td>
<td width="89"><img src="images/1.jpg" /></td>
<td width="96"><img src="images/2.jpg" /></td>
<td width="96"><img src="images/3.jpg" /></td>
<td> </td>
</tr>
<tr>
<td></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="166" height="28"></td>
<td>
<input type="checkbox" name="inst" value="女士上衣">女式上衣 </td>
<td> <input type="checkbox" name="inst" value="男士上衣">男士上衣</td>
<td> <input type="checkbox" name="inst" value="男鞋">男鞋</td>
<td> </td>
</tr>
<tr align="center">
<td height="29" colspan="5">版权所有@ xxx 2010-2011</td>
</tr>
</table>
</body>
</html>
怎么在本页实现跳转后自动去掉登陆框密码框显示的是登陆后的姓名与密码?
[解决办法]
判断request.getParameter("name")和password 看看有没有值,如果没有,就显示登陆框,如果有,则显示名字
<c:choose>
<c:when test="${name!=null && password!=null}">
//在这显示名字
</c:when>
<c:otherwise>
//在这显示登录框的td
</c:otherwise>
</c:choose>
[解决办法]
jsp标签 要不用java小脚本 里面判断下request.getParameter("name")