login.jsp为用户登录界面界面,用户输入用户名和密码后提交表单,由文件loginReceive.jsp接
收用户的输入,如果输入正确,则转到文件loginCorrect.html;如果输入错误,则转到loginError.html.loginReceive.jsp<%@pag...
收用户的输入,如果输入正确,则转到文件loginCorrect.html;如果输入错误,则转到loginError.html.
loginReceive.jsp
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="gbk"%>
<html>
<head>
<title></title>
</head>
<body>
<%
String userName=request.getParameter("userName");
String userPwd=request.getParameter("userPwd");
if(userName.equals("sa")&&userPwd.equals("sa")){
%>
<jsp:forword page="loginCorrect.html"/></jsp:forword>
<%} else {%>
<jsp:forword page="loginError.html"/></jsp:forword>
<%} %>
</body>
</html>
login.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<html>
<head>
<title>用户登录</title>
</head>
<body>
<div align="center">
<p>用户登录</p>
<form name="form1" method="post" action="loginReceive.jsp">
姓名:<input name="userName" type="text" size="12"><br>
密码:<input name="userPwd" type="password" size="12"><br>
<input name="ok" type="submit" value="提交">
<input name="set" type="reset" value="重置">
</form>
</div>
</body>
</html>
有错误
message /loginReceive.jsp(13,8) Invalid standard action
description The server encountered an internal error that prevented it
from fulfilling this request.
来大神看看 展开
loginReceive.jsp
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="gbk"%>
<html>
<head>
<title></title>
</head>
<body>
<%
String userName=request.getParameter("userName");
String userPwd=request.getParameter("userPwd");
if(userName.equals("sa")&&userPwd.equals("sa")){
%>
<jsp:forword page="loginCorrect.html"/></jsp:forword>
<%} else {%>
<jsp:forword page="loginError.html"/></jsp:forword>
<%} %>
</body>
</html>
login.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<html>
<head>
<title>用户登录</title>
</head>
<body>
<div align="center">
<p>用户登录</p>
<form name="form1" method="post" action="loginReceive.jsp">
姓名:<input name="userName" type="text" size="12"><br>
密码:<input name="userPwd" type="password" size="12"><br>
<input name="ok" type="submit" value="提交">
<input name="set" type="reset" value="重置">
</form>
</div>
</body>
</html>
有错误
message /loginReceive.jsp(13,8) Invalid standard action
description The server encountered an internal error that prevented it
from fulfilling this request.
来大神看看 展开
2个回答
2017-07-03
展开全部
主要是loginReceive.jsp有问题,修改如下:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
String userName = request.getParameter("userName");
String userPwd = request.getParameter("userPwd");
if (userName.equals("sa") && userPwd.equals("sa")) {
%>
<!-- forward拼写错误 -->
<jsp:forward page="loginCorrect.html" />
<%
} else {
%>
<jsp:forward page="loginError.html" />
<%
}
%>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询