Compiling a Java.War File

I need help on how to make some changes to some .jsp pages that are contained within a .war package.

I use jbilling software to run open source and you need to change some elements / display and do it directly in .jsp, so I unzipped the .war file and made the changes, then packed it and inserted the webapps folder and restarted tomcat into it. But I noticed that the file size from the .war that I was packing was smaller than the original .war, and it had to be larger because I added material to it. Needless to say, tomcat did not start properly, or at least there were errors in the logs ... but they did not help me, and jbilling did not work correctly. I went back to orignal.war and it worked fine.

Is it possible that I will unzip the .war file and just make some html changes and then repack it without recompiling all the source code using java classes? Did I use the packaging tool to create the compilation? Is there any other way to accomplish what I'm trying to do?

I did this in the FreeBSD field using the following commands: unpack -> sudo jar cf ../billing.war * repackages -> sudo jar -xvf billing.war

Thank you for your help.

+4
source share
2 answers

In addition .WAR and .JAR (AFAIK is all for everyone. * AR) are mostly distinguished zip files that meet some structural requirements (manifests, web application descriptors, etc.). The easiest way to make the necessary changes is to process the .WAR file as if it were a simple ZIP file. The choice of tools is yours (archiver, pkzip, etc.).

+1
source

You can simply open the war file with archiver utility (it seems you are using ubuntu).

Open the jsp file from the archiver, using it yourself, make changes, and the Archiver utility will ask that the jsp file has been modified you want to update your war file say yes there .

Note If you are going to view only the changes, than to take this difficult path, otherwise, if you want to change the source java files than building the war will be strongly recommended

+1
source

All Articles