What's the difference in HotDeploy and Publish, Start and how they relate

5

When I add tomcat to eclipse some options appear: Start be Publish . How do these relate to hotdeploy ?

    
asked by anonymous 18.06.2014 / 14:49

1 answer

2

Start and Debug

The Start option will initialize the server and, as a consequence, the applications that are associated with it. It is the equivalent of Run for JavaSE. If you want to debug the application, use Debug .

Publish

The Publish option will copy the changed files in your project to the folder configured in your Tomcat, making them available for new requests. But note that this does not imply restarting the server, so if tomcat is set to cache it may not take effect immediately.

In addition, by default Tomcat is set to auto-%% when you change a file in the project. This setting can be changed by clicking the Publish option in the menu that appears in the question.

Sometimes Eclipse loses the synchronization between project and Tomcat for some reason. You can then open the Tomcat item by clicking the arrow, right-clicking on a specific application, and selecting the Properties option, which will force the full copy of the application to the Tomcat folder.

Hot Deploy

It is the ability to update the system without restarting Tomcat or the Application.

However, there are several things to consider:

  • Configuration change: It is up to the framework to recognize these changes
  • Change in classes: Normal JDK works if you are in Debug mode and do not change method signatures or create new attributes in classes.
  • Changing static resources: works fine for images, scripts, etc., but if you have some kind of framework for views you will have to configure it to reload them.

Finally, every technology has its nuances.

However, the biggest problem of restarting the application (if it is not too slow) is that the session will be lost and you will need to log in again and restart the tests. So it's interesting to implement a login that redirects the user to the last page he was accessing.

    
18.06.2014 / 18:29