简体   繁体   English

我是否需要为每个jsp或java更改重新启动tomcat的所有内容?

[英]Do I have to restart tomcat everything for every jsp or java change?

I am running tomcat v7.0 within my eclipse. 我在日食中运行的是tomcat v7.0。 I have to restart tomcat for every single jsp or java change. 我必须为每个jsp或java更改重新启动tomcat。 I am sure I have set my server wrong somehow. 我确定我以某种方式设置了服务器错误。 How can I see my changes without keep restarting tomcat? 如何在不保持重新启动tomcat的情况下查看更改?

Thanks! 谢谢!

When you are deploying to the tomcat from eclipse, If you are planning to work without deploying every time you to a change to the code base, you can use Jrebel. 当您从eclipse部署到tomcat时,如果您计划工作而无需每次都部署代码库,则可以使用Jrebel。

Jrebel will sense your changes and take care of the re-deploying. Jrebel会感知到您所做的更改,并会进行重新部署。 Only issue is that It is a have to buy plugin and I know there are opensource or free applications like that. 唯一的问题是,这是一个必须购买的插件,我知道有这样的开源或免费应用程序。

如果您以DEBUG模式运行该应用程序,则您对JSP或Java代码进行的任何更改都会自动重启。

You can try deleting the tomcat instance from eclipse and also the Servers folder that is present in the Project Explorer. 您可以尝试从eclipse中删除tomcat实例,也可以从Project Explorer中删除Servers文件夹。 Add your server to eclipse again and deploy your war file. 将服务器再次添加到eclipse并部署war文件。 The changes to JSP or javascript files will now reflect without a server restart. 现在,无需重新启动服务器即可反映对JSP或javascript文件的更改。

That not necessary it's depend upon your configuration When you configure Tomcat in eclipse then we have 3 option 没必要,这取决于您的配置当您在eclipse中配置Tomcat时,我们有3个选项

  1. never publish automatically 永远不会自动发布
  2. automatically publish when resource change 资源更改时自动发布
  3. automatically publish after build event 构建事件后自动发布

so you can configure this as per your requirement.You get this option once you create tomcat server in eclipse ,then select the tomcat server,then either press F3 or right click and open. 因此,您可以根据需要进行配置。在eclipse中创建tomcat服务器后,您将获得此选项,然后选择tomcat服务器,然后按F3或右键单击并打开。 i prefer point 2 to select and make sure you have uncheck build automatically in eclipse ,so that once you sure about all the changes you can build the project and tomcat get restart automaticcaly 我更喜欢第2点进行选择,并确保您已取消选中eclipse中的自动生成功能,这样一旦您确定了所有更改,就可以生成项目,并且tomcat可以自动重启

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM