You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacques Capesius <ja...@cnt.com> on 2003/01/21 18:31:26 UTC

[beginner question] reloading classes

Hi folks,

I'm new to Tomcat, but not as new to J2EE. I have a jsp, and I made a change
to a class that's being loaded into it as a bean, but I can't get the page
to use the new class and not the old one. 

My question, thus, is: when I make changes to a class, how do I get Tomcat
to reload the class?

Restarting Tomcat doesn't seem to do the trick. 

Searching the web, I found a doc that made mention that "touching" the
web.xml file would force the reloading of the class. I tried that and it
didn't work.

I also read somewhere that going to the application (where the JSPs are) and
typing ANT would force the recompile of everything. Still, the old class is
being used.

I'm storing the class in %catalina_home%/classes/PSQ/. I'm loading it into
the jsp by means of the following line of code:

<jsp:useBean id="psq" class="PSQ.PSQ" scope="session"/>

I've made sure there are no other versions of PSQ.class in any other places
it might be used, for example, the WEB-INF/classes directory.

Thanks for whatever advice you can give, and I apologize if this question
has been asked many times before. 

-jacques :)

Jacques Capesius
CNT Web Marketing Developer
jacques_capesius@cnt.com
(763) 268-6749

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


encodeURL problem

Posted by "Igor I. Tovstopyat-Nelip" <it...@euch4e.chem.emory.edu>.
Hi,

I developed an app which is heavily relied upon session tracking. It works
good and robust without doing URL rewriting, i.e. without pushing all
emitted URL's through HttpServletResponse.encodeURL() method.

As soon as I start filtering URL's through the encodeURL(), my app breaks.
It starts giving me NullPointerException's at runtime the source of which
I wasn't able to track down so far.

Can anybody suggest what might be the problem?

I'm using Tomcat-4.1-18 and IE5 as a client.

Thank you.

Igor TN


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


Re: [beginner question] reloading classes

Posted by Erik Price <ep...@ptc.com>.
Is it possible that you need to re-compile the JSP file itself?  I don't 
know the mechanics of JSPs, but I know that whenever I include one JSP 
into another at compile time, if I change the "included" JSP, then I 
need to make sure that the "including" JSP is recompiled too.  Otherwise 
the "including" JSP still contains code from the original "included" JSP.

Ant won't update the "including" JSP if it hasn't been touched or 
changed, so if you're using ant, you need to touch the "including" JSP 
and then use ant to deploy your entire webapp.  Are you using ant?  It 
doesn't sound like you're very sure!  If not, ignore what i just said, 
and remove your deployed webapp, then redeploy the whole thing.  You 
should get the changes you are looking for.


Erik




Jacques Capesius wrote:
> Hi folks,
> 
> I'm new to Tomcat, but not as new to J2EE. I have a jsp, and I made a change
> to a class that's being loaded into it as a bean, but I can't get the page
> to use the new class and not the old one. 
> 
> My question, thus, is: when I make changes to a class, how do I get Tomcat
> to reload the class?
> 
> Restarting Tomcat doesn't seem to do the trick. 
> 
> Searching the web, I found a doc that made mention that "touching" the
> web.xml file would force the reloading of the class. I tried that and it
> didn't work.
> 
> I also read somewhere that going to the application (where the JSPs are) and
> typing ANT would force the recompile of everything. Still, the old class is
> being used.
> 
> I'm storing the class in %catalina_home%/classes/PSQ/. I'm loading it into
> the jsp by means of the following line of code:
> 
> <jsp:useBean id="psq" class="PSQ.PSQ" scope="session"/>
> 
> I've made sure there are no other versions of PSQ.class in any other places
> it might be used, for example, the WEB-INF/classes directory.
> 
> Thanks for whatever advice you can give, and I apologize if this question
> has been asked many times before. 
> 
> -jacques :)
> 
> Jacques Capesius
> CNT Web Marketing Developer
> jacques_capesius@cnt.com
> (763) 268-6749
> 
> --
> 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: [beginner question] reloading classes

Posted by Bert Catsburg <be...@catsburg.com>.
Hm, I do not understand why I should restart Tomcat.
The manager webapp should do the trick according to the
documentation. Why does this not work, or does it?

   http://localhost:8080/manager/reload?path=/PAQ

I hope to hear from somebody since I have this same solution.

Thanks,

Bert Catsburg


Richie Chauhan wrote:
> touch the jsp file where the bean is being loaded.
> touch and recompile the bean
> restart tomcat
> try and pull up jsp page now
> 
> That should work - it takes a while to get used to that.
> 
> Richie
> 
> -----Original Message-----
> From: Jacques Capesius [mailto:jacques_capesius@cnt.com]
> Sent: Tuesday, January 21, 2003 9:31 AM
> To: 'Tomcat'
> Subject: [beginner question] reloading classes
> 
> 
> Hi folks,
> 
> I'm new to Tomcat, but not as new to J2EE. I have a jsp, and I made a change
> to a class that's being loaded into it as a bean, but I can't get the page
> to use the new class and not the old one.
> 
> My question, thus, is: when I make changes to a class, how do I get Tomcat
> to reload the class?
> 
> Restarting Tomcat doesn't seem to do the trick.
> 
> Searching the web, I found a doc that made mention that "touching" the
> web.xml file would force the reloading of the class. I tried that and it
> didn't work.
> 
> I also read somewhere that going to the application (where the JSPs are) and
> typing ANT would force the recompile of everything. Still, the old class is
> being used.
> 
> I'm storing the class in %catalina_home%/classes/PSQ/. I'm loading it into
> the jsp by means of the following line of code:
> 
> <jsp:useBean id="psq" class="PSQ.PSQ" scope="session"/>
> 
> I've made sure there are no other versions of PSQ.class in any other places
> it might be used, for example, the WEB-INF/classes directory.
> 
> Thanks for whatever advice you can give, and I apologize if this question
> has been asked many times before.
> 
> -jacques :)
> 
> Jacques Capesius
> CNT Web Marketing Developer
> jacques_capesius@cnt.com
> (763) 268-6749
> 
> --
> 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>
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: [beginner question] reloading classes

Posted by Richie Chauhan <ri...@ajava.biz>.
touch the jsp file where the bean is being loaded.
touch and recompile the bean
restart tomcat
try and pull up jsp page now

That should work - it takes a while to get used to that.

Richie

-----Original Message-----
From: Jacques Capesius [mailto:jacques_capesius@cnt.com]
Sent: Tuesday, January 21, 2003 9:31 AM
To: 'Tomcat'
Subject: [beginner question] reloading classes


Hi folks,

I'm new to Tomcat, but not as new to J2EE. I have a jsp, and I made a change
to a class that's being loaded into it as a bean, but I can't get the page
to use the new class and not the old one.

My question, thus, is: when I make changes to a class, how do I get Tomcat
to reload the class?

Restarting Tomcat doesn't seem to do the trick.

Searching the web, I found a doc that made mention that "touching" the
web.xml file would force the reloading of the class. I tried that and it
didn't work.

I also read somewhere that going to the application (where the JSPs are) and
typing ANT would force the recompile of everything. Still, the old class is
being used.

I'm storing the class in %catalina_home%/classes/PSQ/. I'm loading it into
the jsp by means of the following line of code:

<jsp:useBean id="psq" class="PSQ.PSQ" scope="session"/>

I've made sure there are no other versions of PSQ.class in any other places
it might be used, for example, the WEB-INF/classes directory.

Thanks for whatever advice you can give, and I apologize if this question
has been asked many times before.

-jacques :)

Jacques Capesius
CNT Web Marketing Developer
jacques_capesius@cnt.com
(763) 268-6749

--
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>