求助 jsp

keketian521 2011-05-08 09:12:50
login.jsp:
<%@page contentType="text/html;charset=gb2312"%>
<html>
<head>
<title>表单</title>
</head>
<body>
<form method="post" action="checklogin.jsp">
姓名:<input type="text" name="name">
密码:<input type="password" name="password">
<input type="submit" value="登陆">
</form>
</body>
</html>



checklogin.jsp:
<%@page contentType="text/html;charset=gb2312"%>
<html>
<head>
<title>登陆验证</title>
</head>
<body>
<%--进行登陆检查--%>
<%
String heaking="李小龙";
String name=request.getParameter("name");
String password=request.getParameter("password");

if(name.equals(heaking))
{
%>
<jsp:forward page="sucess.jsp">
<jsp:param name="user" value="<%=name%>"/>
</jsp:forward>
<%
}
else
{
%>
<jsp:forward page="sucess.jsp">
<jsp:param name="user" value="<%=name%>"/>
</jsp:forward>
<%}%>
</body>
</html>


[b]sucess.jsp:[/b]
<%@page contentType="text/html;charset=gb2312"%>

登陆成功
<br>
欢迎你,<%=request.getParameter("user")%>
...全文
31 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

23,405

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧