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.
来大神看看
展开
 我来答
匿名用户
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>
azhqgu
2015-10-19 · TA获得超过323个赞
知道小有建树答主
回答量:563
采纳率:75%
帮助的人:199万
展开全部
你为什么要这样写?Java代码全写jsp上?用标签吧,这种写法应杜绝。N年前的写法了。
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式