You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Maya Vayner <va...@yahoo.com> on 2002/05/08 22:44:28 UTC

Q: How to recompile a JSP page if its include file has been changed?

Hi:
I have a couple of include files (of format <%@ include file=file.jsp %>) inside of all
my jsp files for site generic layout. When a designer makes a change to a navBar.jsp
include file, for example, what we do right now is restart Tomcat to see the changes. 
Is there another way to force a JSP page to recompile besides restarting Tomcat
altogether? 
Thank you.
Maya Vayner

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Q: How to recompile a JSP page if its include file has beenchanged?

Posted by corey <co...@mcn.org>.
>> When a JSP page gets its timestamp changed Tomcat automatically reloads
it. Is
>> there a
>> way to force Tomcat to do that on a non-changed file? On all JSP files?
>
>1. No.
>2. No.

1. Yes... delete the pre-compiled servlet for that JSP.
2. Yes... delete all pre-compiles servlets for your webapp.

You'll find these, by default, in $CATALINA_HOME/work

-corey


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Q: How to recompile a JSP page if its include file has been changed?

Posted by Phillip Morelock <su...@phillipmorelock.com>.
On 5/8/02 2:00 PM, "Maya Vayner" <va...@yahoo.com> wrote:

> When a JSP page gets its timestamp changed Tomcat automatically reloads it. Is
> there a
> way to force Tomcat to do that on a non-changed file? On all JSP files?

1. No.
2. No.

You must update the timestamp, either via touch or via some manual method.
I suppose you could write a shell/batch script to do this for you based on
your specific criteria.  This is an optimization based in the Servlet and
JSP specifications themselves.  It asks the timestamp question because it's
a quick "sanity check" -- do I really need to recompile this?  It is
specified behavior that the container ***not*** recompile "unchanged" jsp's,
and by "unchanged" I mean the timestamp is not newer than the timestamp that
existed at the previous compile-time.

Is this clear as mud ?  ;)

Oh and tomcat WILL NOT check the timestamp on include files.

Hope this helps.

cheers
fillup






> --- Phillip Morelock <su...@phillipmorelock.com> wrote:
>> what do you mean by "automatic reload"?
>> 
>> 
>> 
>> 
>> On 5/8/02 1:53 PM, "Maya Vayner" <va...@yahoo.com> wrote:
>> 
>>> Thank you, this is helpful.
>>> Any suggestions for automatic reload, while Tomcat is  running?
>>> We use Tomcat 4.0. Thanks
>>> --- Phillip Morelock <su...@phillipmorelock.com> wrote:
>>>> on unix / linux you use "touch"
>>>> 
>>>> jsp's compiling is based on their timestamp.  "Was this file modified after
>>>> I last compiled it?"  It does not take into account the include file's
>>>> timestamp.
>>>> 
>>>> i have a command that works on unix to update the times on all your jsps.
>>>> Go into your /webapps directory and type
>>>> find . -name "*.jsp" -exec touch '{}' \;
>>>> 
>>>> or just go to the individual file and type:
>>>> touch MyJsp.jsp
>>>> 
>>>> on dos/windows just open the file in notepad, put in or erase a space or
>>>> return, and then save it.
>>>> 
>>>> cheers
>>>> fillup
>>>> 
>>>> 
>>>> 
>>>> On 5/8/02 1:44 PM, "Maya Vayner" <va...@yahoo.com> wrote:
>>>> 
>>>>> Hi:
>>>>> I have a couple of include files (of format <%@ include file=file.jsp %>)
>>>>> inside of all
>>>>> my jsp files for site generic layout. When a designer makes a change to a
>>>>> navBar.jsp
>>>>> include file, for example, what we do right now is restart Tomcat to see
>>>>> the
>>>>> changes. 
>>>>> Is there another way to force a JSP page to recompile besides restarting
>>>>> Tomcat
>>>>> altogether? 
>>>>> Thank you.
>>>>> Maya Vayner
>>>>> 
>>>>> __________________________________________________
>>>>> Do You Yahoo!?
>>>>> Yahoo! Health - your guide to health and wellness
>>>>> http://health.yahoo.com
>>>>> 
>>>>> --
>>>>> To unsubscribe, e-mail:
>>>>> <ma...@jakarta.apache.org>
>>>>> For additional commands, e-mail:
>>>>> <ma...@jakarta.apache.org>
>>>>> 
>>>> 
>>>> 
>>>> --
>>>> To unsubscribe, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>> For additional commands, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>> 
>>> 
>>> 
>>> __________________________________________________
>>> Do You Yahoo!?
>>> Yahoo! Health - your guide to health and wellness
>>> http://health.yahoo.com
>>> 
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>> For additional commands, e-mail: <ma...@jakarta.apache.org>
>> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Q: How to recompile a JSP page if its include file has been changed?

Posted by Maya Vayner <va...@yahoo.com>.
When a JSP page gets its timestamp changed Tomcat automatically reloads it. Is there a
way to force Tomcat to do that on a non-changed file? On all JSP files? 
--- Phillip Morelock <su...@phillipmorelock.com> wrote:
> what do you mean by "automatic reload"?
> 
> 
> 
> 
> On 5/8/02 1:53 PM, "Maya Vayner" <va...@yahoo.com> wrote:
> 
> > Thank you, this is helpful.
> > Any suggestions for automatic reload, while Tomcat is  running?
> > We use Tomcat 4.0. Thanks
> > --- Phillip Morelock <su...@phillipmorelock.com> wrote:
> >> on unix / linux you use "touch"
> >> 
> >> jsp's compiling is based on their timestamp.  "Was this file modified after
> >> I last compiled it?"  It does not take into account the include file's
> >> timestamp.
> >> 
> >> i have a command that works on unix to update the times on all your jsps.
> >> Go into your /webapps directory and type
> >> find . -name "*.jsp" -exec touch '{}' \;
> >> 
> >> or just go to the individual file and type:
> >> touch MyJsp.jsp
> >> 
> >> on dos/windows just open the file in notepad, put in or erase a space or
> >> return, and then save it.
> >> 
> >> cheers
> >> fillup
> >> 
> >> 
> >> 
> >> On 5/8/02 1:44 PM, "Maya Vayner" <va...@yahoo.com> wrote:
> >> 
> >>> Hi:
> >>> I have a couple of include files (of format <%@ include file=file.jsp %>)
> >>> inside of all
> >>> my jsp files for site generic layout. When a designer makes a change to a
> >>> navBar.jsp
> >>> include file, for example, what we do right now is restart Tomcat to see the
> >>> changes. 
> >>> Is there another way to force a JSP page to recompile besides restarting
> >>> Tomcat
> >>> altogether? 
> >>> Thank you.
> >>> Maya Vayner
> >>> 
> >>> __________________________________________________
> >>> Do You Yahoo!?
> >>> Yahoo! Health - your guide to health and wellness
> >>> http://health.yahoo.com
> >>> 
> >>> --
> >>> To unsubscribe, e-mail:
> >>> <ma...@jakarta.apache.org>
> >>> For additional commands, e-mail:
> >>> <ma...@jakarta.apache.org>
> >>> 
> >> 
> >> 
> >> --
> >> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> >> For additional commands, e-mail: <ma...@jakarta.apache.org>
> >> 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Health - your guide to health and wellness
> > http://health.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> > 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Q: How to recompile a JSP page if its include file has been changed?

Posted by Phillip Morelock <su...@phillipmorelock.com>.
what do you mean by "automatic reload"?




On 5/8/02 1:53 PM, "Maya Vayner" <va...@yahoo.com> wrote:

> Thank you, this is helpful.
> Any suggestions for automatic reload, while Tomcat is  running?
> We use Tomcat 4.0. Thanks
> --- Phillip Morelock <su...@phillipmorelock.com> wrote:
>> on unix / linux you use "touch"
>> 
>> jsp's compiling is based on their timestamp.  "Was this file modified after
>> I last compiled it?"  It does not take into account the include file's
>> timestamp.
>> 
>> i have a command that works on unix to update the times on all your jsps.
>> Go into your /webapps directory and type
>> find . -name "*.jsp" -exec touch '{}' \;
>> 
>> or just go to the individual file and type:
>> touch MyJsp.jsp
>> 
>> on dos/windows just open the file in notepad, put in or erase a space or
>> return, and then save it.
>> 
>> cheers
>> fillup
>> 
>> 
>> 
>> On 5/8/02 1:44 PM, "Maya Vayner" <va...@yahoo.com> wrote:
>> 
>>> Hi:
>>> I have a couple of include files (of format <%@ include file=file.jsp %>)
>>> inside of all
>>> my jsp files for site generic layout. When a designer makes a change to a
>>> navBar.jsp
>>> include file, for example, what we do right now is restart Tomcat to see the
>>> changes. 
>>> Is there another way to force a JSP page to recompile besides restarting
>>> Tomcat
>>> altogether? 
>>> Thank you.
>>> Maya Vayner
>>> 
>>> __________________________________________________
>>> Do You Yahoo!?
>>> Yahoo! Health - your guide to health and wellness
>>> http://health.yahoo.com
>>> 
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>> For additional commands, e-mail: <ma...@jakarta.apache.org>
>> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Q: How to recompile a JSP page if its include file has been changed?

Posted by Maya Vayner <va...@yahoo.com>.
Thank you, this is helpful. 
Any suggestions for automatic reload, while Tomcat is  running?
We use Tomcat 4.0. Thanks
--- Phillip Morelock <su...@phillipmorelock.com> wrote:
> on unix / linux you use "touch"
> 
> jsp's compiling is based on their timestamp.  "Was this file modified after
> I last compiled it?"  It does not take into account the include file's
> timestamp.
> 
> i have a command that works on unix to update the times on all your jsps.
> Go into your /webapps directory and type
> find . -name "*.jsp" -exec touch '{}' \;
> 
> or just go to the individual file and type:
> touch MyJsp.jsp
> 
> on dos/windows just open the file in notepad, put in or erase a space or
> return, and then save it.
> 
> cheers
> fillup
> 
> 
> 
> On 5/8/02 1:44 PM, "Maya Vayner" <va...@yahoo.com> wrote:
> 
> > Hi:
> > I have a couple of include files (of format <%@ include file=file.jsp %>)
> > inside of all
> > my jsp files for site generic layout. When a designer makes a change to a
> > navBar.jsp
> > include file, for example, what we do right now is restart Tomcat to see the
> > changes. 
> > Is there another way to force a JSP page to recompile besides restarting
> > Tomcat
> > altogether? 
> > Thank you.
> > Maya Vayner
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Health - your guide to health and wellness
> > http://health.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> > 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Q: How to recompile a JSP page if its include file has been changed?

Posted by Phillip Morelock <su...@phillipmorelock.com>.
on unix / linux you use "touch"

jsp's compiling is based on their timestamp.  "Was this file modified after
I last compiled it?"  It does not take into account the include file's
timestamp.

i have a command that works on unix to update the times on all your jsps.
Go into your /webapps directory and type
find . -name "*.jsp" -exec touch '{}' \;

or just go to the individual file and type:
touch MyJsp.jsp

on dos/windows just open the file in notepad, put in or erase a space or
return, and then save it.

cheers
fillup



On 5/8/02 1:44 PM, "Maya Vayner" <va...@yahoo.com> wrote:

> Hi:
> I have a couple of include files (of format <%@ include file=file.jsp %>)
> inside of all
> my jsp files for site generic layout. When a designer makes a change to a
> navBar.jsp
> include file, for example, what we do right now is restart Tomcat to see the
> changes. 
> Is there another way to force a JSP page to recompile besides restarting
> Tomcat
> altogether? 
> Thank you.
> Maya Vayner
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Q: How to recompile a JSP page if its include file has been changed?

Posted by Adam Pfeiffer <ad...@yahoo.com>.
If you are on a unix system, you can just touch the file.  It should then recompile the jsp. 
Note, you would have to touch every file that used the included file.

Adam

--- Maya Vayner <va...@yahoo.com> wrote:
> Hi:
> I have a couple of include files (of format <%@ include file=file.jsp %>) inside of all
> my jsp files for site generic layout. When a designer makes a change to a navBar.jsp
> include file, for example, what we do right now is restart Tomcat to see the changes. 
> Is there another way to force a JSP page to recompile besides restarting Tomcat
> altogether? 
> Thank you.
> Maya Vayner
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>