tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 13378] New: - Generated code assumes definition of getServletContext() in base class.
Date Mon, 07 Oct 2002 18:39:53 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13378>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13378

Generated code assumes definition of getServletContext() in base class.

           Summary: Generated code assumes definition of getServletContext()
                    in base class.
           Product: Tomcat 3
           Version: 3.3.1 Final
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: jorgen@polopoly.com


When Java code is generated for a JSP page containing TAG-LIB, it is assumed
that the method getServletContext() is defined in the base class (which it is in
for example org.apache.jasper.runtime.HttpJspBase). But getServletContext() is
not part of the Servlet API!

I would like to be able to use any base class that implements the Servlet API
for my JSPs. Does anybody know why getServletContext(), which belongs to the
ServletConfig API, is assumed in base class? I can't find any support of that in
the standard.


>From the generated code:

package foobar;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;


public class taglib_4 extends com.mycompany.MyClass {
...
    public final synchronized void _jspx_init() throws
org.apache.jasper.JasperException {
        if (! _jspx_inited) {
            org.apache.jasper.runtime.TagPoolManager tagPoolManager =
                (org.apache.jasper.runtime.TagPoolManager)
getServletContext().getAttribute("org.apache.jasper.runtime.TagPoolManager");
...
}


>From error message:

Method getServletContext() not found in class foobar.taglib_4.
                (org.apache.jasper.runtime.TagPoolManager)
getServletContext().getAttribute("org.apache.jasper.runtime.TagPoolManager")

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message