Stop Eclipse restarting my web app on file save

允我心安 提交于 2019-11-28 07:41:12

问题


I'm creating a JSF/Facelets web app in Eclipse. I've configured my project to use a Tomcat (6.0) server that is started/stopped by Eclipse.

Whenever I save a file (eg .xhtml) Eclipse restarts the app, trashing my HTTP session. This is annoying, because I'm frequently updating my .xhtml files, and the app doesn't need restarting to detect the changes.

Is there a way to stop Eclipse restarting the app? Specifically, can I configure Eclipse to only restart the app when I save files of a certain type?


回答1:


In the server View, double click on your Tomcat instance. This will open the properties of your Tomcat server. As I am not sure of which parameter will help you to solve your problem, check the following options in the latter view:

  • Automatic Publishing, option "Override default settings" selected, 1 second for the publishing interval.
  • In server options, uncheck options "Server modules without publishing" and "publish module contexts to separate XML files".
  • In the modules tab, for each modules deployed, check that Auto Reload is enabled.

Hope this will help you.




回答2:


I have always used this and it works fine for me. The context is reloaded only when you change classes or the web descriptor.

In your project structure where you keep .xhtml files which makes eclipse reload the context on changing?




回答3:


This can happen if you have a builder in Eclipse set to deploy on save. Right click on your project -> properties -> builders




回答4:


Turn off "Build Automatically"



来源:https://stackoverflow.com/questions/712232/stop-eclipse-restarting-my-web-app-on-file-save

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!