weixin_45612522
愀棤
2020-03-07 16:28

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

  • java
  • tomcat
  • java-ee
  • eclipse

新手小白,求帮助!!!
我的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条回答