开发者

How to place one file in tomcat instead redeploy whole war?

We are having a web app in a remote server. The whole app size is about 30mb. For every enhancement, we will be adding one or more jsps and .class files. We wont touch .js files and image files.

So for this requirement, we send those files to our email and then paste the files in the web app开发者_运维问答 and then we do restart the tomcat server to catch the new files. I feel lazy to do the above process.

Is there any way to put single file in tomcat web app?


If you deploy exploded app, i.e. your code is in individual .class files instead of .jar files, you can replace individual files. The problem is that Java class loaders in general (except of the special cases like OSGI containers), and Tomcat class loader specifically, would not replace a class that is already in the memory, it will not get replaced. So, you'll have to restart Tomcat. With JSPs it gets a bit trickier, because Tomcat compiles them into classes and appears to rely on the timestamp of that generated class when it decides whether to recompile a JSP.

I remember doing it like that back in Java 1.2 and Tomcat 4 days, but it ended up being a bigger hassle than it was worth. Just do yourself a favor and script your build to produce a WAR file and to give some indication, preferably in the UI, what build is particular web app is running.


KwateeSDCM can incrementally update webapps. Just keep using your build-chain that generates a war. Then you deploy that war with KwateeSDCM (can be automated with REST interface) which keeps an MD5 hash of every file and only updates the ones that have actually changed. There's a specific tutorial for deploying tomcat webapps with KwateeSDCM here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜