Idea每次修改jsp都需要重启tomcat解决方法

2019/05/28 15:40
阅读数 7

<div class="blog-content-box"> <div class="article-header-box"> <div class="article-header"> <div class="article-title-box"> <span class="article-type type-1 float-left">原</span> <h1 class="title-article">Idea每次修改jsp都需要重启tomcat解决方法</h1> </div> <div class="article-info-box"> <div class="article-bar-top"> <span class="time">2018年04月19日 15:52:46</span> <a class="follow-nickName" href="https://me.csdn.net/xzj80927" target="_blank">xzj80927</a> <span class="read-count">阅读数:5488</span> </div> <div class="operating"> </div> </div> </div> </div> <article class="baidu_pl"> <div id="article_content" class="article_content clearfix csdn-tracking-statistics" data-pid="blog" data-mod="popu_307" data-dsm="post"> <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css"> <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css"> <div class="htmledit_views" id="content_views"> <p>今天自己搭建的spring+springmvc+mybatis时,发现修改的Jsp页面静态数据,刷新页面不能及时生效,需要重启tomcat才能生效。把解决方法归纳如下:</p><p>1、选择tomcat设置:</p><p></p><div><img src="https://note.youdao.com/yws/res/10215/WEBRESOURCE95a5ce77608d857af203bef51ea946b7" style="width:484px;" alt=""></div><p>2、进行如下设置:</p><p><img src="https://img-blog.csdn.net/20180419154846339?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3h6ajgwOTI3/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70" alt=""><br></p><p></p><div style="white-space:pre-wrap;line-height:1.75;font-size:14px;"><strong style="background-color:rgb(255,255,255);">说明:</strong></div><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);">on ‘update‘ action:当用户主动执行更新的时候更新    快捷键:Ctrl + F9</p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);">on frame deactication:在编辑窗口失去焦点的时候更新</p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);">你可以根据自己的需求进行设置,我这里两个都有设置。</p><p></p><div style="white-space:pre-wrap;line-height:1.75;font-size:14px;"><strong style="background-color:rgb(255,255,255);"><br></strong></div><div style="white-space:pre-wrap;line-height:1.75;font-size:14px;"><strong style="background-color:rgb(255,255,255);">注意</strong>:经过测试,如果,采取如下方式,不能及时生效:</div><div><img src="https://note.youdao.com/yws/res/10220/WEBRESOURCE793e09b832c06e29c09a1adafcc71b10" style="width:537px;" alt=""></div><div style="white-space:pre-wrap;line-height:1.75;font-size:14px;">,采取下面的方式也可以生效:</div><div><img src="https://note.youdao.com/yws/res/10222/WEBRESOURCE89136fc7016e0cb9d3b4a5b8681ab0c2" style="width:556px;" alt=""></div><div style="white-space:pre-wrap;line-height:1.75;font-size:14px;"><br></div><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);"></p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);">3、如果你的工程中没有 Update classes and resources 这个选项,只有如下选项那么请接着往下看,因为我开始也是这样的,在这种情况下你更新后只能更新classes文件中的变动,并不能更新静态文件中的变动。</p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);"><img src="https://images2015.cnblogs.com/blog/720608/201610/720608-20161022145110170-405477147.png" alt="技术分享" style="padding:0px;border:0px;max-width:900px;"></p><br><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);"><br></p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);">出现这种选项情况的原因是因为你在Deployment的选项中使用的是先将工程打成war包然后再去运行的。</p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);"><img src="https://images2015.cnblogs.com/blog/720608/201610/720608-20161022145616373-833217578.png" alt="技术分享" style="padding:0px;border:0px;max-width:900px;"></p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);">&nbsp;</p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);">修改方式:</p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);">先remove当前工程,再次添加,添加的时候选择Artiface</p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);"><img src="https://images2015.cnblogs.com/blog/720608/201610/720608-20161022145718013-917799720.png" alt="技术分享" style="padding:0px;border:0px;max-width:900px;"></p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);">然后选择工程名称后面有 exploded的选项</p><p style="margin:10px auto;font-size:14px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;background-color:rgb(255,255,255);"><img src="https://images2015.cnblogs.com/blog/720608/201610/720608-20161022145845029-1896732874.png" alt="技术分享" style="padding:0px;border:0px;max-width:900px;"></p><p><br></p><p>说明:</p><p><span style="color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:14px;background-color:rgb(255,255,255);">___:war exploded&nbsp;</span><br style="margin:0px;padding:0px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:14px;background-color:rgb(255,255,255);"><span style="color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:14px;background-color:rgb(255,255,255);">  展开部署(相当于将资源文件进行展开后进行部署)</span><br style="margin:0px;padding:0px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:14px;background-color:rgb(255,255,255);"><span style="color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:14px;background-color:rgb(255,255,255);">___:war</span><br style="margin:0px;padding:0px;color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:14px;background-color:rgb(255,255,255);"><span style="color:rgb(64,50,38);font-family:'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:14px;background-color:rgb(255,255,255);">  发布模式,这是先打成war包,再部署</span><br></p><p><br></p> </div> </div> </article> </div>

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部