What is the difference between Hotdeploy and Publish, Start and with

Asked

Viewed 197 times

5

When I add Tomcat to the eclipse some options appear to me : Start be Publish. How these relate to the hotdeploy?

inserir a descrição da imagem aqui

1 answer

2


Start and Debug

The option Start 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 the Debug.

Publish

Already the option Publish 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 configured to cache it may not have immediate effect.

Also, by default Tomcat is configured to do the Publish automatic when you change a file in the project. This setting can be changed by clicking on the option Properties from the menu presented in the question.

Sometimes Eclipse loses sync 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 option Full Publish, 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 situations to consider:

  • Configuration change: it depends on the framework to recognize these changes
  • Changing classes: normal JDK works if it is in Debug mode and if it does not change method signatures or create new attributes in classes.
  • Static resource change: works well for images, scripts, etc., but if you have some kind of framework for the views you will have to configure it to recharge them.

Anyway, every technology has its nuances.

However, the biggest problem of needing to restart 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. That’s why it’s interesting to implement a login that redirects the user to the last page he was accessing.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.