Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > how to cause tomcat to automatically reload a changed javabean?

Reply
Thread Tools

how to cause tomcat to automatically reload a changed javabean?

 
 
Alex Hunsley
Guest
Posts: n/a
 
      09-03-2004
I'm using Apache Tomcat/5.0.27 to test some JSPs, that in turn use some
javabeans I have written.
Tomcat seems to recompile changed jsp files just fine, and AFAIK it would
reload a servlet if the class file had changed (recompiled), but it's not
noticing that I have recompiled the classes that define javabeans. At the
moment I am stopping and restarting tomcat to force a reload of the javabean
classes.

I've tried closing my browser then loading the page again in a new instance of
the browser (because my jsp pages have the 'session' scope and I wondered if
this was the problem) but tomcat is still not using the new javabean class file.

Any hints anyone? Currently plunging through the docs as googling didn't bring
up much...

thanks
alex

 
Reply With Quote
 
 
 
 
William Brogden
Guest
Posts: n/a
 
      09-03-2004
On Fri, 03 Sep 2004 15:42:22 +0100, Alex Hunsley
<(E-Mail Removed)> wrote:

> I'm using Apache Tomcat/5.0.27 to test some JSPs, that in turn use some
> javabeans I have written.
> Tomcat seems to recompile changed jsp files just fine, and AFAIK it
> would reload a servlet if the class file had changed (recompiled), but
> it's not noticing that I have recompiled the classes that define
> javabeans. At the moment I am stopping and restarting tomcat to force a
> reload of the javabean classes.
>
> I've tried closing my browser then loading the page again in a new
> instance of the browser (because my jsp pages have the 'session' scope
> and I wondered if this was the problem) but tomcat is still not using
> the new javabean class file.
>
> Any hints anyone? Currently plunging through the docs as googling didn't
> bring up much...
>
> thanks
> alex
>


Use the Management application to force a complete reload of
your application. I'm assuming your javabeans are part of this
application and are not shared by other applications.

Bill
 
Reply With Quote
 
 
 
 
Alex Hunsley
Guest
Posts: n/a
 
      09-03-2004
William Brogden wrote:

> On Fri, 03 Sep 2004 15:42:22 +0100, Alex Hunsley
> <(E-Mail Removed)> wrote:
>
>> I'm using Apache Tomcat/5.0.27 to test some JSPs, that in turn use
>> some javabeans I have written.
>> Tomcat seems to recompile changed jsp files just fine, and AFAIK it
>> would reload a servlet if the class file had changed (recompiled),
>> but it's not noticing that I have recompiled the classes that define
>> javabeans. At the moment I am stopping and restarting tomcat to force
>> a reload of the javabean classes.
>>
>> I've tried closing my browser then loading the page again in a new
>> instance of the browser (because my jsp pages have the 'session'
>> scope and I wondered if this was the problem) but tomcat is still not
>> using the new javabean class file.
>>
>> Any hints anyone? Currently plunging through the docs as googling
>> didn't bring up much...
>>
>> thanks
>> alex
>>

>
> Use the Management application to force a complete reload of
> your application. I'm assuming your javabeans are part of this
> application and are not shared by other applications.
>
> Bill


Yup, it's standalone, so that would work. Maybe I'll just go with that then if
it's the best way.

ta
alex

 
Reply With Quote
 
Chris Riesbeck
Guest
Posts: n/a
 
      09-03-2004
In article <(E-Mail Removed)>,
Alex Hunsley <(E-Mail Removed)> wrote:

> I'm using Apache Tomcat/5.0.27 to test some JSPs, that in turn use some
> javabeans I have written.
> Tomcat seems to recompile changed jsp files just fine, and AFAIK it would
> reload a servlet if the class file had changed (recompiled), but it's not
> noticing that I have recompiled the classes that define javabeans. At the
> moment I am stopping and restarting tomcat to force a reload of the javabean
> classes.


Make an XML Context fragment for your webapp.

E.g., if you have a GraderServlet, with URL /grader, create
grader.xml with


<Context path="/grader" docBase="../webapps/grader" debug="0"
reloadable="true" />


and put this file in

<tomcat-directory>/conf/Catalina/localhost/
 
Reply With Quote
 
Alex Hunsley
Guest
Posts: n/a
 
      09-06-2004
Chris Riesbeck wrote:
> In article <(E-Mail Removed)>,
> Alex Hunsley <(E-Mail Removed)> wrote:
>
>
>>I'm using Apache Tomcat/5.0.27 to test some JSPs, that in turn use some
>>javabeans I have written.
>>Tomcat seems to recompile changed jsp files just fine, and AFAIK it would
>>reload a servlet if the class file had changed (recompiled), but it's not
>>noticing that I have recompiled the classes that define javabeans. At the
>>moment I am stopping and restarting tomcat to force a reload of the javabean
>>classes.

>
>
> Make an XML Context fragment for your webapp.
>
> E.g., if you have a GraderServlet, with URL /grader, create
> grader.xml with
>
>
> <Context path="/grader" docBase="../webapps/grader" debug="0"
> reloadable="true" />
>
>
> and put this file in
>
> <tomcat-directory>/conf/Catalina/localhost/


Ah, thank you! That worked a treat.

alex

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cause webpage one to reload when webpage two is closed. Paul ASP .Net 14 06-19-2008 03:02 PM
JavaScript refresh: <a href="#" onClick="window.location.reload( true );">Reload</a> Joshua Beall HTML 26 06-29-2007 06:31 PM
problem with reload(sys) (doing reload on the sys module) gen_tricomi Python 2 05-23-2006 10:03 AM
Is there an SNMP equivalent to "Reload in [x]" / "Reload cancel" commands? steve.chambers@gmail.com Cisco 5 05-20-2006 04:06 AM
will all these messages cause a problem . I am a new subscriber and my computer is downloading 100,000 messages. Will this cause any kind of a problem with my ability to store other items?? Camille White Camille White Computer Support 9 11-08-2004 01:13 AM



Advertisments