0 Replies Latest reply on Aug 7, 2003 7:43 AM by shandrilavj

    Tomcat unable to compile jsp using application.getAttribute(

    shandrilavj

      Hi
      I am using Version jboss-3.2.1_tomcat-4.1.24.
      Which I try to access a jsp page which uses the Servlet application scope to retrieve a particular attribute using application.getAttribute, I get the following errors:

      org.apache.jasper.JasperException: Unable to compile class for JSP
      An error occurred at line : -1 in the jsp file : null
      Generated servlet error:compiling 1 source file
      And the error is pointing to the variable
      application, in the below line.
      PAList appList = (PAList) application.getAttribute(PAList.SERVICE_NAME);

      I was able to compile the jsp when I replaced the above syntax, with the below lines.
      PAList appList = (PAList ) pageContext.getServletContext().getAttribute(PAList .SERVICE_NAME);

      Could someone explain me why I could not use the application scope to retrieve attributes.

      Thanks
      Shandrila