I understand the structural difference between a JAR and a WAR file, as is answered beautifully on this page.
To me, it seems like WAR was just an archive type that was made retroactively to make it clear that the particular distributable is a web application, and not just an application.
My question: I'm curious to know why someone can't just take all the contents that would normally be placed in a WAR, and package & deploy them as a JAR instead? It just seems that WAR is an un-ncessary/non-mandatory file type.
Thanks in advance!
It's not even a filetype, it's just an filename extension + content structure.
I guess there are some tools that expect *.war file and if you give them *.jar they don't know that to do with it.
I'd bet most web app containers instead of unpacking the archive just look at the extension to decide if/how the app has to be deployed. Saves some time and cpu cycles.