Java – How to hot-deploy jsp file to tomcat

javajsptomcat

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 ?

Best Answer

As the linked question doesn't really go into details ...

In $CATALINA_BASE/conf/server.xml, 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">

By default, Tomcat will check for changes to JSP files. In fact, you have to change that for production, as described here.

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.