Why don't one just put files in a sub directory under webapps directory? Are there any advantages of WAR in server performance?
There is no performance benefit in using WAR files. Indeed, a typical web container unpacks the deployed WAR file into the the webapp's directory before running the webapp ... and this takes time.
The real benefit of WAR and EAR files is in simplicity of deployment ... assuming that you are not doing something unsound like developing code on a live production server.
WAR files are pretty much just archives, but they contain the structure of the site and package everything together in a standard format. If the files are in a WAR, they are just unpacked by the server at deploy time anyway, there isnt any performance gain except the fact that it is easier to deploy.
You could just put the items in a sub directory if you really wanted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With