File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Refreshing JSP and servlet in TOMCAT3.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Refreshing JSP and servlet in TOMCAT3.2" Watch "Refreshing JSP and servlet in TOMCAT3.2" New topic
Author

Refreshing JSP and servlet in TOMCAT3.2

Cherry Mathew
Ranch Hand

Joined: Dec 26, 2000
Posts: 159
Hi,
Iam using tomat3.2 for application development. When i make changes in the JSP its not getting refreshed and its giving me the old page. Even if i restart tomcat im getting the same problem. So first i got to delete the folder corresponding to the current context from the work folder and then restart the server. I dont think this is the correct thing to do. and also for servlets whenever i make some changes i got to restart the machine.
Im not using the ANT tool for building the application. will it make any difference. I dont think this will make any differnce.
Im specifying reload in my server.xml in the <Context> tag.
What else shud i do to make it refresh the JSP.
If there are any more tips using tomcat please reply.
Thanks in advance
Cherry
Anoop Krishnan
Ranch Hand

Joined: May 03, 2001
Posts: 163
Hai Cherry,
I think your Context tag look like this
<Context path="/myproject" docBase="myproject" debug="0" reloadable="false"/>
now change it like this
<Context path="/myproject" docBase="myproject" debug="0" reloadable="true"/>

I just want to know is there any body call my bean's Getter and Setter methods with "Please" in front - My favorite quip from Bugzilla
Cherry Mathew
Ranch Hand

Joined: Dec 26, 2000
Posts: 159
Hi Anup,
I did give reloadable = true in the context but still its not working?. Im connecting tomcat with apache
I m using tomcat 3.2
Thanks in advance
Cherry
Cherry Mathew
Ranch Hand

Joined: Dec 26, 2000
Posts: 159
No replies???/
timothy zimmerman
Ranch Hand

Joined: Jun 26, 2001
Posts: 149
I'm sort of stuck on this too. A quote from the Jakarts FAQ O Matic
'Note that modified JSP pages are "automatically reloaded" though.
This works without the auto-reload feature, since a brand new class
is created for the modified page, and the new class simply replaces
the old class.'
But like yourself I have had to clear my work directory and restart. Anybody else have experience with this?
Ashwin Asani
Greenhorn

Joined: Jun 14, 2001
Posts: 6
Hi,
My tomcat installation is reloading servlets without any problems.
Whenever I had problems with jsp, I used to clear the work directory, clear the browser cache & disk cache and then run the file again. It would work fine after that.
In apache however, we have autoreloading capabilities that work fine. There is no need of a server restart in that case.
[This message has been edited by Ashwin Asani (edited July 18, 2001).]
Cherry Mathew
Ranch Hand

Joined: Dec 26, 2000
Posts: 159
Hi ashwini
Clearing the work directory and restarting the sever is fine it works but its time consumuing in a development environment. If the jsp page is automatically reloaded its the better way of doing this.
I did put autoreload=true and still its not refreshing the jsp page. i think its bcos of the timestamp of the jsp page. but cant figure out how to do it.
Cherry
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
I had this same problem with JSP's until I changed the location where I put my JSP's. I never had the problem with servlets. I know it's also location dependent too. I am at work now, so I don't remember the exact directory off hand. I just know that Tomcat automatically reloads servlets and JSP's in a specific directory.
Bosun

Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157

After that, you have the correct heirarchy in the webapps folder.
Hope this helps,
Sandeep
[This message has been edited by Desai Sandeep (edited July 18, 2001).]
Sarah Waterson
Greenhorn

Joined: Jul 19, 2001
Posts: 2
I'm having the exact same problems - even with everything in the server.xml file set up for the application to be reloadable, I can't get changes to show up with out clearing EVERYTHING and starting over. I'm also using 3.2 - could this be the problem?
Sarah Waterson
Greenhorn

Joined: Jul 19, 2001
Posts: 2
ahh... discovered the problem I was having. I was making changes to files statically INCLUDED in the .jsp files, but not resaving/re-timestamping the actual .jsp file iteslf, so it was never getting recompiled, and thus, never including my changes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Refreshing JSP and servlet in TOMCAT3.2