Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
674 views
in Technique[技术] by (71.8m points)

java - How to hot-deploy jsp file to tomcat?

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 ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...