不忘初心
方得始终

IDEA–Tomcate配置中的On Upate Action 与 On Frame Deactivation

这两个选项的设置,依赖于项目的部署方式是 exploded

一、on update action

首先来看 on update action 相关的解释,从字面上理解 就是 手工触发 update 动作的时候 做什么:

update resources —— 更新静态的资源,比如html,js,css等 运行模式和调试模式都是立即生效。

update classes and resources —— 更新java,jsp和静态资源(

1. java 修改后,会被编译成.class 然后覆盖到target/kao文件夹下,IDE调试模式的情况下,立即生效。IDE运行模式下,不立即生效,需要redeployed才可生效。

2. jsp修改后,再次被访问的时候,会自动更新,重新编译成.java——>.class 保存在tomcat的work目录下。由于是访问时才检测是否修改,是否需要重新编译,所以 IDE 运行模式 和 IDE调试模式下,都是立即生效。刷新下页面就可);

redeployed ——- 重新部署,发布到tomcat里,不重启tomcat,而是把原来的删掉,然后重新发布;

restart server ——- 重启tomcat

2、再来看on frame deactivation

意思是 IDEA 失活时 做什么,就是说 IDEA 失去焦点时 做什么。

Do nothing ————- 什么都不做
update resources —— 更新静态的资源,比如html,js,css等 运行模式和调试模式都是立即生效。
update classes and resources —— 更新java,jsp和静态资源 同上。
验证上方的结论看如下GIF:
静态资源不用测试了,测试 On Update Action 的 (update classes and resources)在debug模式 与 运行模式下的差别。
1.运行模式下,jsp是 update classes and resources 是立即生效的,但是.java文件修改后 并不会立即生效。

2.debug调试模式下,jsp和java文件修改 都会立即生效:

3.测试on frame deactivation 即IDE 失去焦点时自动做一些事, 我们测试 让其update classes and resources ,以调试模式为例,运行模式除了java 修改不会自动生效,其它一致;

总结,这样设置是最佳的选择:

因为On frame deactivation IDE失去焦点的情况下 自动触发,而开发过程中 可能需要查询资料 或 与人聊天 或干其它事,IDE需要不停的失去焦点。每次失去焦点就自动触发 update ,CPU一下子 费很多,电脑瞬间变慢,所以没有必要这样,设置为Do nothing 最好,官方也默认的是 Do nothing。
On Update action ———- update classes and resources ——- 运行模式下(jsp 立即生效,java 需要redeploy才可生效)
On Update action ———- update classes and resources ——- 调试模式下(java、jsp 都立即生效)

赞(0) 支持我
未经允许不得转载:woytu » IDEA–Tomcate配置中的On Upate Action 与 On Frame Deactivation

评论 4

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    Magnificent goods from you, man. I’ve bear in mind your stuff previous to and
    you’re just too great. I actually like what you have got right here, really like what
    you are stating and the way in which in which you
    are saying it. You are making it entertaining and you continue to care for to keep it sensible.
    I can’t wait to learn far more from you. That is actually a wonderful website.

    Сialis 2个月前 (01-03) Russian Federation 谷歌浏览器 Linux 回复
  2. #2

    Good day! Do you use Twitter? I’d like to follow you
    if that would be ok. I’m absolutely enjoying your blog and look
    forward to new posts.

    BocaHickory.Com 2周前 (02-01) 这家伙可能用了美佬的代理 谷歌浏览器 Ubuntu Linux 回复
  3. #3

    Hi there, I found your web site by the use of Google at the same time as looking for a comparable matter, your website got here
    up, it seems great. I’ve bookmarked it in my google bookmarks.

    Hello there, simply changed into aware of your blog through
    Google, and located that it is truly informative. I
    am gonna be careful for brussels. I will appreciate in the event you proceed this
    in future. Lots of folks will likely be benefited from your writing.
    Cheers!

    Jeff Nadrich 2周前 (02-07) Brazil 谷歌浏览器 Mac OS X 10_10_2 回复
  4. #4

    You’re so interesting! I don’t believe I’ve truly read through a single
    thing like this before. So great to discover somebody with a few genuine thoughts on this issue.
    Seriously.. many thanks for starting this up. This site is something
    that is required on the web, someone with some originality!