• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Restarting apache tomcat after changes in servlet and jsps

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.

 
reply
    Bookmark Topic Watch Topic
  • New Topic