开发者

Do I have to restart Tomcat each time I update the website in Eclipse?

I'm following 开发者_JAVA技巧coreServlet tutorial and sometimes when I create new file or update them, then check it on browser things don't work so I restart the server and they go fine, I'm a humble beginner in web. Does restarting the browser something like compiling in desktop environment ? do I have to ? each time ? I couldn't help but notice (synchronized) word next to project name in Servers TAB that's what raised the question if it's synced why do I have to ? or this means something else ?

anyway I'm running ubuntu and eclipse Indigo, it crashed btw moments ago when I restarted the server again 4th time maybe. Sorry for telling too much info, just trying to put the full picture here.


Restarting is not necessary. You can also just publish. Rightclick the server entry in Servers view and choose Publish. It should then appear as Synchronized. You can even configure Eclipse to autopublish changes to the server on intervals, which can even be set to 0 seconds. Doubleclick the server entry and head to the right top section:

Do I have to restart Tomcat each time I update the website in Eclipse?


However, a small warning is at its place: Tomcat is a terrible hotpublisher. Basically, it redeploys the entire webapplication. If you have only one project deployed, then it's not faster than just restarting the server. Also, if you publish too much, don't be surprised if you face OutOfMemoryError: PermGen sooner or later.

JRebel helps a lot, I also use it at work for JBoss (which is basically nothing more than a glorified Tomcat with a bunch of additional Java EE aspectcs put on top (JSF, EJB, JPA, JAX-RS, JMS, Mail, etc, etc)) and it instantly reloads the changed class in server's memory on save. You just have to press F5 in browser within the same second.

Or, grab Glassfish. It does that out the box without any additional tools/plugins.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜