user1541389
user1541389

Reputation: 115

What is the best practice to recover from a .war file into a web application

Our organization invested in a java web application that we want to be able to develop upon. Unfortunately last developer left with only the .war file. How can we recover some of the class files, change them then redeploy as war again. We tried to do that in Eclipse but after importing as war, we could not configure build path. (which in my understanding, the war was imported as static project). I could not find "Convert to dynamic project" as said in eclipse help document.

Upvotes: 1

Views: 447

Answers (3)

Beryllium
Beryllium

Reputation: 13008

There is another option for special cases: Have a look at aspectj, so you can

  • weave in additional code around method calls to fix bugs etc.
  • add fields or methods etc.

It works on the byte code level (it works with .class files).

As for the long run, grab what you recover using a decompiler, and start to replace class files step by step.

Upvotes: 0

Arun Manivannan
Arun Manivannan

Reputation: 4313

Java Decompiler is the best I've ever come across. You could open your entire war with this.

Upvotes: 0

RGG
RGG

Reputation: 1913

A .jar/.war file is compressed using the ZIP format. You can decompress it using any zip utility like WinZIP/WinRAR/etc. and then use your favorite decompiler on the .class files.

Upvotes: 3

Related Questions