You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Reynir Hübner <Re...@hugsmidjan.is> on 2001/07/19 15:48:18 UTC

Class reloading for JSP /Tomcat 4

Hi, I have a problem : 

I have Tomcat 4 and a working MVC model.

Request are handled by a servlet that starts a servlet chain wich ends
with the request being routed to a JSP. 
The servlets in the chain instanciate beans and put them into the
request object.  

If I change one .java-file (servlet or bean) and recompile I get a
ClassCastException (in the jsp) when I try to use ANY of the beans
(previously populated with servlets) in the JSP <jsp:useBean> tag.

I seems that the classloader.reload in tomcat 4 works for the servlets
(catalina ?) but not for the jsp pages  (jasper ?).

btw. if I restart after recompiling the class tomcat everything works as
it should.

So now I´m wondering if this is a bug (? or a feature?) and how to
overcome this :)

thanx

-reynir
reynir@hugsmidjan.is


Re: Class reloading for JSP /Tomcat 4

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 19 Jul 2001, Reynir Hübner wrote:

> Hi, I have a problem : 
> 
> I have Tomcat 4 and a working MVC model.
> 
> Request are handled by a servlet that starts a servlet chain wich ends
> with the request being routed to a JSP. 
> The servlets in the chain instanciate beans and put them into the
> request object.  
> 
> If I change one .java-file (servlet or bean) and recompile I get a
> ClassCastException (in the jsp) when I try to use ANY of the beans
> (previously populated with servlets) in the JSP <jsp:useBean> tag.
> 
> I seems that the classloader.reload in tomcat 4 works for the servlets
> (catalina ?) but not for the jsp pages  (jasper ?).
> 
> btw. if I restart after recompiling the class tomcat everything works as
> it should.
> 
> So now I´m wondering if this is a bug (? or a feature?) and how to
> overcome this :)
> 

Tomcat 4.0-b6 fixes several issues related to reloading, including:
- Changes to JSP pages weren't being recognized in 4.0-b5 (although this
  was fixed in recent nightly releases)
- Changes to classes in a JAR file under /WEB-INF/lib were not recognized
- Reloading was not cleaning out the servlet context attributes created
  by the old version of the app, which could lead to class cast exception
  problems.

Try it, you'll like it :-).

> thanx
> 
> -reynir
> reynir@hugsmidjan.is
> 
> 
Craig McClanahan