如何将jsp文件热部署到tomcat? [英] How to hot-deploy jsp file to tomcat?
问题描述
我不想每次在JSP文件中进行一些编辑时都生成一个war文件.我希望事情能与PHP一起使用.如何热部署到tomcat服务器?热部署是Java标准吗?
I don't want to build a war file each time I make a little edit in a JSP file. I want things to work like with PHP. How can I hot-deploy to a tomcat server? Is hot-deploy a java standard?
可以在我的软件的发行版本中使用这种热部署吗?
Can this kind of hot-deploy be used in a released version of my software ?
推荐答案
由于链接的问题并未真正涉及细节...
As the linked question doesn't really go into details ...
在$CATALINA_BASE/conf/server.xm
l中,您需要配置本地服务器以解压缩WAR.这是我的开发服务器中的示例:
In $CATALINA_BASE/conf/server.xm
l, you need to configure the local server to unpack WARs. Here's the example from my development server:
<Host appBase="webapps" autoDeploy="true" deployOnStartup="true"
deployXML="true" name="localhost" unpackWARs="true">
默认情况下,Tomcat将检查对JSP文件的更改.实际上,您必须针对生产进行更改,如这里.
By default, Tomcat will check for changes to JSP files. In fact, you have to change that for production, as described here.
在进行了这些更改之后,您将在$CATALINA_BASE/work/Catalina/localhost
中找到您的Web应用程序(再次假设是默认安装;如果要配置服务器名称,则不会是localhost
).就地编辑文件,更改将在您下次加载页面时显示.
With these changes in place, you will find your web-app in $CATALINA_BASE/work/Catalina/localhost
(assuming, again, a default install; if you're configuring server name, it won't be localhost
). Edit the file in-place, and the changes will appear when you load the page next.
这种热部署可以在我的软件的发行版中使用
Is this kind of hot-deploy can be used in a release versioin of my software
如果您想避免难以追踪的错误,那就不要.
Not if you want to avoid hard-to-track-down bugs.
这篇关于如何将jsp文件热部署到tomcat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!