简体   繁体   English

Tomcat不重新部署修改过的JSP?

[英]Tomcat do not redeploy modified JSP?

Though I'm not much experience in it, but have seen many times that modified JSP sometimes don't get change while refreshing the page. 尽管我没有太多经验,但是经过很多次修改后的JSP有时在刷新页面时没有得到更改。 I have to manually delete the source and .class of JSP from \\work\\Catalina\\localhost..., only after that I get change. 我必须从\\ work \\ Catalina \\ localhost ...手动删除JSP的源代码和.class,直到获得更改。 WHY?? 为什么??

A lot of times when I have made changes to JSPs and it doesn't show up there was a syntax error with the JSP. 很多时候,我对JSP进行了更改,但没有显示出JSP的语法错误。 Check your tomcat log to see if there was an exception while compiling the JSP. 检查您的tomcat日志以查看编译JSP时是否存在异常。

Depending on settings, Tomcat should be able to auto reload JSPs when you reinstall the war file. 根据设置,当您重新安装war文件时,Tomcat应该能够自动重新加载JSP。 That being said, the behavior has always been extremely flakey for for me. 话虽这么说,对我而言,这种举动一直是极其极端的。 What I tend to do is create a Makefile (even if using ant or maven for builds) to install new copies of the war file: Effectively, it: 我倾向于做的是创建一个Makefile(即使使用ant或maven进行构建)来安装war文件的新副本:实际上,它是:

  1. If work directory exists in ${tomcat} , delete it 如果${tomcat}存在work目录,请将其删除
  2. If ${webapp} directory exists in ${tomcat}/webapps , delete it 如果${webapp} ${tomcat}/webapps存在${webapp}目录,请将其删除
  3. Copy ${dev}/target/${webapp}.war to ${tomcat}/webapps ${dev}/target/${webapp}.war复制到${tomcat}/webapps

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

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