主题:用户登陆界面为什么无法运行?
<%--MyJsp.jsp--%>
<%@page language="java" contentType="text/html;charset=gb2312"%>
<html>
<head></head>
<body>
<FORM name="login" method="POST">
<INPUT type="text" name="name" />
<INPUT type="password" name="password" />
<INPUT type="Submit" name="button1" value="提交" />
</FORM>
<%--JSP部分--%>
<%
String name = request.getParameter("name");
String password = request.getParameter("password");
if( name.equals("killercat") && password.equals("123"))
{
%>
<jsp:forward page="success.jsp">
<jsp:param name = "user" value = "<%=name%>" />
</jsp:forward>
<%
}else{
%>
<jsp:forward page="error.jsp">
<jsp:param name="user" value="<%=name%>"/>
</jsp:forward>
<%}%>
</body>
</html>
<%--error.jsp--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'error.jsp' starting page</title>
</head>
<body>
不存在用户:<%=request.getParameter("user")%><br>
</body>
</html>
<%--success.jsp--%>
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
欢迎<%=request.getParameter("user")%>光临本网站<br>
</body>
</html>
<%@page language="java" contentType="text/html;charset=gb2312"%>
<html>
<head></head>
<body>
<FORM name="login" method="POST">
<INPUT type="text" name="name" />
<INPUT type="password" name="password" />
<INPUT type="Submit" name="button1" value="提交" />
</FORM>
<%--JSP部分--%>
<%
String name = request.getParameter("name");
String password = request.getParameter("password");
if( name.equals("killercat") && password.equals("123"))
{
%>
<jsp:forward page="success.jsp">
<jsp:param name = "user" value = "<%=name%>" />
</jsp:forward>
<%
}else{
%>
<jsp:forward page="error.jsp">
<jsp:param name="user" value="<%=name%>"/>
</jsp:forward>
<%}%>
</body>
</html>
<%--error.jsp--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'error.jsp' starting page</title>
</head>
<body>
不存在用户:<%=request.getParameter("user")%><br>
</body>
</html>
<%--success.jsp--%>
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
欢迎<%=request.getParameter("user")%>光临本网站<br>
</body>
</html>