日期:2014-05-17  浏览次数:20816 次

新手页面传值的问题
登入页面如下loggin.jsp
<%@ page contentType="text/html; charset=utf-8" %>
<center><h3>用户登入</h3></center>
<form action="inside.jsp" method="post">
<table width="298" border="0" align="center" cellpadding="2"
  cellspacing="1">
  <tr><td align="right">用户名</td>
  <td align="left"><input name="user" type="text" size="15" value="admin"/></td></tr>
  <tr><td align="right">密码</td>
  <td align="left"><input name="password" type="text" size="15" value="admin"/></td>
  </tr>
  <tr><td colspan="2" align="center"><input type="submit" value="登入" />
  <input type="reset" value="取消"> </td>
  </td>
  </tr>
  </table>
 </form>

跳转的页面inside.jsp代码如下

<%
String user = request.getParameter("user");
String password = request.getParameter("password");
System.out.println(user);
if(user.equals("admin") && password.equals("admin")){
%>
<jsp:forward page="success.jsp">
<% }
else
{
%>
<jsp:forward page="fail.jsp"/>
<% } %>

运行时报错
type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: /inside.jsp(9,1) Expecting "jsp:param" standard action with "name" and "value" attributes
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
org.apache.jasper.compiler.Parser.parseParam(Parser.java:827)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1665)

。。。。

求助

------解决方案--------------------
/inside.jsp(9,1)

inside.jsp第9行,是否使用了jsp:param标签?
------解决方案--------------------
<jsp:forward page="success.jsp" />

------解决方案--------------------
取出的数据 你还要转换格式 
转换成String类型的
------解决方案--------------------
Java code
<jsp:forward page="success.jsp"/>
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.aiyiweb.com/java-web/317.html