Note that there are some explanatory texts on larger screens.

plurals
  1. POThe method getContextPath() is undefined for the type ServletContext
    text
    copied!<p>Here is my JSP:</p> <pre><code>&lt;HTML&gt; &lt;BODY &gt; path : &lt;%= application.getContextPath() %&gt; &lt;/BODY&gt; &lt;/HTML&gt; </code></pre> <p>This file is correct in Tomcat7 and Tomcat6, but when I request the JSP page in Tomcat 5.32 of my Cpanel hosting, I get the following exception:</p> <pre><code>org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 3 in the jsp file: /cal2.jsp The method getContextPath() is undefined for the type ServletContext 1: &lt;HTML&gt; 2: &lt;BODY&gt; 3: path : &lt;%= application.getContextPath() %&gt; 4: &lt;/BODY&gt; 5: &lt;/HTML&gt; Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:328) org.apache.jasper.compiler.Compiler.compile(Compiler.java:307) org.apache.jasper.compiler.Compiler.compile(Compiler.java:295) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) javax.servlet.http.HttpServlet.service(HttpServlet.java:72 </code></pre> <p>How is this problem caused and how can I solve it?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload