tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rachel Greenham <>
Subject ClassLoader in Jsp superclass
Date Fri, 11 Aug 2000 14:27:32 GMT
I created my own JSP superclass, because I needed to make available
facilities in another servlet to JSP scripts. So I duly implemented the
HttpJspPage interface.

However, when I tried to use beans, where they would be instantiated (eg:
<jsp:useBean id="testbean" scope="request" class="test.TestBean"/>) it
failed with a compilation error, complaining that there was no such method
"getClassLoader()". This, of course, is absolutely true, there isn't. :-)

So I looked into org.apache.jasper.runtime.HttpJspBase and wasn't surprised
to find a protected ClassLoader getClassLoader() method in there, as well as
a companion setClassLoader(ClassLoader). I just copied these into my JSP
superclass and it's all hunky-dory.

... But if that getClassLoader() is so important, surely it should be
defined in the HttpJspPage interface? Failing that, perhaps the JSP
precompiler should default to using getClass().getClassLoader() or

Any thoughts? Am I coming into an old argument? :-}


View raw message