愀棤 2020-03-07 16:28 采纳率: 33.3%
浏览 491
已采纳

eclipse的jsp页面报 request类型的getParemater(String)方法 不存在于 HttpServletRequest错误,要怎么解决?

新手小白,求帮助!!!
我的JAVAEE在tomcat运行的时候报错,我检查过Java Build Path里的文件并没有发现问题,但我还是重新添加了server runtion 和JRE System Library,再次运行后却依然报错。后来我手动查找servlet内的request.getParemater()发现类方法还是缺失,报错代码为以下内容:

`HTTP Status 500 - Unable to compile class for JSP:


type Exception report

message Unable to compile class for JSP:

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

exception

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

An error occurred at line: 12 in the jsp file: /deallogin.jsp
The method getParemater(String) is undefined for the type HttpServletRequest
9:


10: <%@ page import="java.util.*"%>
11: <%
12: String username = request.getParemater("username");
13: String password = request.getParemater("password");
14: String character =request.getParemater("character");
15: if("Ann".equals(username)&& "123".equals(password)){

An error occurred at line: 13 in the jsp file: /deallogin.jsp
The method getParemater(String) is undefined for the type HttpServletRequest
10: <%@ page import="java.util.*"%>
11: <%
12: String username = request.getParemater("username");
13: String password = request.getParemater("password");
14: String character =request.getParemater("character");
15: if("Ann".equals(username)&& "123".equals(password)){
16: out.print(character+"登录成功!");

An error occurred at line: 14 in the jsp file: /deallogin.jsp
The method getParemater(String) is undefined for the type HttpServletRequest
11: <%
12: String username = request.getParemater("username");
13: String password = request.getParemater("password");
14: String character =request.getParemater("character");
15: if("Ann".equals(username)&& "123".equals(password)){
16: out.print(character+"登录成功!");

17: }else{

Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:490)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:379)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

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

``

  • 写回答

1条回答 默认 最新

  • zqbnqsdsmd 2020-03-07 21:59
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大