File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Updating your Action Servlets as runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Updating your Action Servlets as runtime" Watch "Updating your Action Servlets as runtime" New topic

Updating your Action Servlets as runtime

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 751
Hi guys, I was wondering... In plain ol servlets, when you make changes to your servlet, you would usually have to restart tomcat. Since I haven't tested struts on a live running site(uploaded on the internet) with users accessing your files/classes most of the time. Would it be ok to just replace the old class files with a new one without restarting the server? I'm getting a little anxious about the impact it could cause to my app's performance. I have a feeling that there would be frequent changes, and that It would require me to update the classes on the server as soon as changes are made. Thanks!

SCJP 1.5
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
When I'm testing, I frequently make changes to my Action and model classes without restarting the application. Most of the time, it works fine, but there are a few "gotchas". I find that if I try to change a Static field or method, it doesn't work. I have to restart. If you make changes to your struts-config.xml file, there's no getting around it.. you must restart the application.

Consultant, Sima Solutions
I agree. Here's the link:
subject: Updating your Action Servlets as runtime
It's not a secret anymore!