On Thu, 12 Apr 2001, Luise Massimo wrote:

> Hi all,
> i have a simple question for which i haven't found an answare by myself: why
> for the same JSP page tomcat generate a new java/class file in work dir for
> every modification ?

Reloading issues. 

"Normal" reloading ( that is used for regular servlets ) is implemented by
replacing the ClassLoader ( after you load a class with a class loader,
you just can't load a newer version ). This creates a number of problems -
all other servlets and classes must be reloaded, session objects and
attributes must also be reloaded ( class loaders define separate
namespaces, objects loaded with sibling loaders can't communicate ).

Jasper ( and any other system that generates servlets ) has another option
- to generate a new class name and use the old loader. Given that JSPs are
typically modified many times this saves a lot of overhead.

This is not an absolute requirement - it's easy to change jasper to use
the "servlet" reloading mechanism ( unfortunately you can't use versioning
on regular servlets - since the class name is fixed ).

Costin 



Reply via email to