>
> I need some help in JSP,If I request a JSP file for the first time then
> that JSP file is parsed into servlet and compiled to class file
> if i made a change in Java file and compile it then the changes are not
> effecting why?
> If i change in JSP file then the display is Effecting.
>
> How the Webserver knows the JSP File has modified ?
>
> is the webserver see the Timestramp of JSP file ?
>
> or It is based on any other thing.
>

My understanding is that if your compiled class is included of the "normal"
classpath, then it is not reloaded by the servlet engine when it changes (at
least in Apache JServ). It needs to be part of a special servlet zone
classpath. I found the text below at:
http://www.magiccookie.com/computers/apache-jserv/  (full article).

============================================
Each servlet zone is assigned its own class loader. The zone's class loader
is responsible for loading class definitions from class repositories into
the JVM and for detecting modifications to class repositories. For instance,
if you have two zones, A and B, and each of them uses class C from
repository R, then there will be two copies of class C, each copy of which
is inaccessible to the other copy. Likewise, any objects that are instances
of class C are inaccessible to other zones. It does not matter that the
repository is the same file or directory, since each sone has a separate
class loader.

A useful feature when developing servlets is the ability to automatically
reload classes when they are modified. Apache JServ will automatically
reload classes if a repository containing a class has been modified. A
servlet zone will also be reloaded if its properties file is modified. This
allows you to install and test new versions of your servlets without having
to restart your web server.

Classes in a servlet zone's repositories list are available only to that
zone. Also, only classes loaded from a servlet zone's repositories are
subject to automatic reloading if the servlet zone's repositories or
properties file are modified. In contrast, classes in the system class path
are not automatically reloaded. This lets you place commonly used and/or
stable classes in the system class path, thus providing access to shared
classes and improving overall performance. For instance, classes in the JDK
and JSDK should be placed in the system class path. Likewise, if you have a
stable and commonly used library, such as a JDBC driver, you will probably
want to add it to the system class path.

Automatic class reloading reduces performance because every repository must
be checked on each and every execution of a servlet. Automatic class
reloading is enabled by default. You can disable class reloading for a
particular zone by setting the autoreload properties in the zone's property
file to false. This can lead to significant performance improvements at the
cost of a more cumbersome development cycle requiring a server restart if a
class file is modified.
==============================================

I guess the JSP page mechanism is different. The JSP pages are compiled on
the fly to a servlet, and presumably this uses a servlet zone classpath to
overcome the problem of reloading the class.

HTH

John Wheeler.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to