aspose file tools*
The moose likes Servlets and the fly likes Restarting apache tomcat after changes in servlet and jsps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Restarting apache tomcat after changes in servlet and jsps" Watch "Restarting apache tomcat after changes in servlet and jsps" New topic
Author

Restarting apache tomcat after changes in servlet and jsps

Augustin Smith
Greenhorn

Joined: Aug 09, 2009
Posts: 12

Whenever we modify a user-defined Servlet class, we need to Restart the Apache Tomcat Server.

Whenever we modify a JSP file, we need NOT Restart the Apache Tomcat Server.

As we know, JSP converts to a Servlet class, how is it that AT Server is able to pick up modifications in JSP file
without restarting the server, but not with Servlet classes.
Himanshu Kansal
Ranch Hand

Joined: Jul 05, 2009
Posts: 257
Hello Augustin,

Servlets are compiled classes we burry somewhere under WEB-INF but AT copies them to its base working location to run them. Until they are changed at THAT location, the changes won't reflect and AT does that only at a server restart.

JSPs, almost always(I'll explain), are taken from the source folder and the changes are reflected.

Why "almost always" : Sometimes you would find that the servlets get stuck in the container and no matter what you do in your JSPs they are just not refreshed/changes don't show up. This happens because at times the container simply does not overwrite the files at the base working location.

Regards


Experience and talent are independent of age
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 684


Hi Augustin Smith,

When you deploy your web application then Jsp file deploy as it is in Tomcat. Yes your are right that Jsp convert into servlet but that process happens into tomcat work/catalina folder. But Jsp deploy same it is at tomcat. So you don't required to restart your tomcat.

But one thing it is not necessary to all times you have to restart your server after change in Servlet or any other Java class. You can use Hot Deployment option using always start your tomcat with debug mode. That will not always required to restart your tomcat.


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Restarting apache tomcat after changes in servlet and jsps
 
Similar Threads
Pro Jakarta Struts, Second Edition : Development Question
Restarting Tomcat
Apache Servlet JSP Restart
Restarting Websphere v5.0 Test Environment
Difference between JSP and Servlets