The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

i can not get contextpath()

Discussion in 'General Discussion' started by amini, Sep 16, 2011.

  1. amini

    amini Registered

    Joined:
    Sep 14, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    this my code :
    <HTML>

    <BODY >
    path : <%= application.getContextPath() %>
    </BODY>
    </HTML>
    this file is correct in tomcat7, tomcat6 but when i requested mypage in cpanel+tomcat5.32 i get is error :

    org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 3 in the jsp file: /cal2.jspThe method getContextPath() is undefined for the type ServletContext1: <HTML>2: <BODY >3: path : <%= application.getContextPath() %> 4: </BODY>5: </HTML>6: 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

    please help me !
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator

Share This Page