• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt about WAR file

 
Luis Torres
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this sentence:

"WAR files must be created by using archive tools to designed specifically for that purpose".

Is true or false? My guess is true.

Thanks for your help.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess is "false" A WAR file is just a good old zip file. If you respect the directory structure described in the specification, you can make a WAR with any file compression tool.
 
Sandip Kaviman
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think as long as WAR has all the necessary files and folder structure as per specification, then it should be good.
 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"WAR files must be created by using archive tools to designed specifically for that purpose".
No,there is no hard and fast rule that war files can created only by using archive tools . to deploy it successfully it must have j2ee webapp structure.this is what is must.
 
Krishna Srinivasan
Ranch Hand
Posts: 1876
Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree
Originally posted by Christophe Verre:
My guess is "false" A WAR file is just a good old zip file. If you respect the directory structure described in the specification, you can make a WAR with any file compression tool.
 
Kunal Jag
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you respect the directory structure described in the specification, you can make a WAR with any file compression tool.


That's absolutely correct!

The directory structure of a Web application, as defined by the servlet specification, has two parts:
1. A private directory called WEB-INF. This directory contains the application's DD, named web.xml, and other private resources.
2. All resources not under the WEB-INF node of the Web application directory structure are public resources.

This means that as long as you're following the above packaging rules, you can create a WAR using the standard jar command, as shown below:



This command will produce an archive file named mcgrawhill.war.

Regards,
[ June 16, 2008: Message edited by: Kunal Jag ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic