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

1、错误描述

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

An error occurred at line: 12 in the jsp file: /resource/pages/storageTankQuery/storageTankInfo/storageTankInfo.jsp
basePath cannot be resolved to a variable
9:     // 璺緞閰嶇疆
10:     require.config({
11:         paths: {
12:             echarts: '<%=basePath %>/resource/global/plugins/echarts/build/dist'
13:         }
14:     });
15:     

Stacktrace:
	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
	at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:476)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

2、错误原因

由于jsp中获取路径用到了“<%=basePath %>”,但是没有path和basePath

3、解决办法

在jsp头上加上下段:

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;

%>

时间: 2024-11-03 20:50:33

Count:858org.apache.jasper.JasperException: Unable to compile class for JSP的相关文章

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

部署war时,遇到下面异常: exception org.apache.jasper.JasperException: Unable to compile class for JSP org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:604) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328

解决Jsp运行org.apache.jasper.JasperException: Unable to compile class for JSP:问题

初学Maven就遇到困难了!!!在b站跟着视频开始接触maven来创建一个webapp项目,在jsp跳转的时候遇到一个bug,身边也没大佬带,只能自己慢慢摸索,在Maven项目中出现了报org.apache.jasper.JasperException: Unable to compile class for JSP:的问题,在网上查了很多方法来尝试解决,但天资愚钝无法理解大佬的跳转思维,后面某论坛看到解决放方案. 链接:https://blog.csdn.net/u011781521/arti

JAVA Drp项目实战—— Unable to compile class for JSP 一波三折

交代下背景,电脑系统是64位的,用的是64位的Tomcat,安装是32位的Myeclipse10,java环境也是32位的,Tomcat在开始启动时会报这样一个错误,"Can't load IA 64-bit .dll on a AMD32-bit platform",但是不耽误使用,最近在敲Drp项目中用到了底层接口的几个方法,这个错误导致项目不能正常运行了,所以就将64位的Tomcat换成了与java环境一样的32位的Tomcat,上面的问题就顺利解决了,于是继续自己的开发,但是当

Unable to compile class for JSP 错误的解决过程。

刚配置好Tomcat.启动项目没问题.然后一访问就报错了. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2012-8-18 19:17:40 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet jsp threw exception org.apac

jsp调用javabean出现错误HTTP Status 500 - Unable to compile class for JSP

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.JasperE

Maven项目不能编译jsp解决方法:Unable to compile class for JSP

一.问题描述: 先交代开发环境,JDK是1.8的,IDE是eclipse 4.7,web服务器是Tomcat 9.0,maven是3.5.0,搭建好环境后输入命令tomcat:run,然后就报org.apache.jasper.JasperException: Unable to compile class for JSP错误. 二.分析问题: (1)不能编译应该是没有导入servlet-api.jsp-api包的原因,然后就在pom文件中加上servlet-api.jsp-api包,为了防止包

Message Unable to compile class for JSP

使用 UniEAPWorkshop_5.0运行4.6 的代码,流程新建时出现的错误 JDK 使用C:\Program Files (x86)\Java\jdk1.7.0_80 tomcat使用 apache-tomcat-7.0.91   改成apache-tomcat-6.0.41 解决! HTTP Status 500 – Internal Server Error ---------------------------------------------------------------

报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17) equal symbol expected

现象:写了如下一个jsp文件,导入需要用到的两个包: 运行结果报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17) equal symbol expected at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41) at org.apache.jasper.compiler.ErrorDis

org.apache.jasper.JasperException

1.错误描述 2014-7-13 17:20:50 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [jsp] in context with path [/FirstSSH] threw exception [/pages/student.jsp (line: 3, column: 0) /pages/pathTags.jsp (line: 1, column: 59)