| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1533 人关注过本帖
标题:jsp登陆页面HTTP Status 500 - 错误,为什么
只看楼主 加入收藏
jackie29
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-7-27
收藏
 问题点数:0 回复次数:3 
jsp登陆页面HTTP Status 500 - 错误,为什么

我做了两个文件
(1)ch7-1.html
<html>
<title>信息输入表单</title>
<body>
<form action="ch7-1.jsp" method="post">
<table border="1">
<tr><td bgcolor="yellow">姓名:</td>
<td><input type="text" name="name"></td></tr>
<tr><td bgcolor="yellow">住址:</td>
<td><input type="text" name="addr"></td></tr>
<tr><td bgcolor="yellow">E-mail:</td>
<td><input type="text" name="email"></td></tr>
<tr><td colspan="2" align="center">
<input type="submit" value="确定">
<input type="reset" value="取消">
</td></tr>
</table>
</form>
</body>
</html>

(2)ch7-1.jsp文件
<html>
<title>getParameter方法使用</title>
<body>
<%
string name=request.getparameter("name");
string email=request.getparameter("email");
string address=request.getparameter("addr");
%>
<%=name%><br>
E-mail <%=email%><br>
<%=adress%>
</body>
</html>


运行tomat6.0时页面显示的错误提示如下:
http://127.0.0.1:8080/myapp/ch7-1.jsp
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
string cannot be resolved to a type

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
The method getparameter(String) is undefined for the type HttpServletRequest

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
string cannot be resolved to a type

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
The method getparameter(String) is undefined for the type HttpServletRequest

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
string cannot be resolved to a type

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
The method getparameter(String) is undefined for the type HttpServletRequest

An error occurred at line: 11 in the jsp file: /ch7-1.jsp
Generated servlet error:
adress cannot be resolved


org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:565)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:354)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
string cannot be resolved to a type

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
The method getparameter(String) is undefined for the type HttpServletRequest

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
string cannot be resolved to a type

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
The method getparameter(String) is undefined for the type HttpServletRequest

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
string cannot be resolved to a type

An error occurred at line: 4 in the jsp file: /ch7-1.jsp
Generated servlet error:
The method getparameter(String) is undefined for the type HttpServletRequest

An error occurred at line: 11 in the jsp file: /ch7-1.jsp
Generated servlet error:
adress cannot be resolved


org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:329)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.2 logs.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.2

由于我是自学的 所以不知道问题出现错误的原因 希望能够得到各位的帮助
谢谢!!!
急!急!急!急!急!急!急!急!急!急!急!急!

搜索更多相关主题的帖子: Status HTTP jsp 页面 登陆 
2006-12-13 12:58
禹_二
Rank: 1
等 级:新手上路
帖 子:661
专家分:0
注 册:2006-9-13
收藏
得分:0 

String,首字母要大写,
getParameter("name");
大小写是有区别的.


2006-12-13 13:42
jackie29
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-7-27
收藏
得分:0 
谢谢了 版主!!~
2006-12-14 18:19
ming206
Rank: 2
来 自:重庆
等 级:等待验证会员
威 望:3
帖 子:545
专家分:7
注 册:2005-8-2
收藏
得分:0 

平时自己看打出的代码颜色是什么样?正确时颜色是不一样的。


外贸综合平台:E贸通
2006-12-14 19:18
快速回复:jsp登陆页面HTTP Status 500 - 错误,为什么
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026358 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved