aspose file tools*
The moose likes Servlets and the fly likes how to create WAR files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to create WAR files" Watch "how to create WAR files" New topic
Author

how to create WAR files

Sreedhar mar
Ranch Hand

Joined: Sep 15, 2003
Posts: 34
i hava no idea about WAR files.How to create WAR files .What are the files or directorys need to crate it.
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Have a look at this link, it explains WAR quite well -
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/WCC3.html
- Manish
Gayathri Prasad
Ranch Hand

Joined: Jun 25, 2003
Posts: 116
Hi ,
You need to have RI to see some code in action for link given by Manish.Its lot better to have RI and check for urself some code in action.So if u dont have the RI download it from the Sun site.WAR stands for Web ARchive and essentially this is very similar to JAR but when we pack together the web components, the WAR is an appropriate term .
Cheers,
Gaya3

----------------
Prasanna Kumar R.V
Tina Williams
Greenhorn

Joined: Sep 10, 2003
Posts: 5
What do you mean by RI?
Idly Vada
Ranch Hand

Joined: Sep 02, 2003
Posts: 135
Originally posted by Tina Williams:
What do you mean by RI?

J2EE Reference Implementation.
This comes along with Sun J2EE SDK
Jithesh Kozhipurath
Ranch Hand

Joined: Aug 27, 2003
Posts: 76
Hai,
War stands for web archive. U can copy the file to ur web server root directory. so that it will extract automatically to the root folder and u can simply rum that from there.
But What is this RI?


Jithesh K
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
Hi all...
This confusion about RI...well Sun has 2 containers to run J2EE application
1. J2EE Reference Implementation(J2EE RI)
2. Sun One Application Server(SoAS)
J2EE RI
This one is for pc's having <128MB RAM on Win 2k or Win98,Win Me.
J2EE RI

SoAS
This is for systems running Win2k with >128 MB RAM.
SoAS
Copy of J2EE SDK
hth
MB
[ September 17, 2003: Message edited by: Malhar Barai ]

Malhar Barai
SOA & Java Book
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

I'm not sure what Gayathri is taking about: you do not need any implementation of J2EE in order to create a war file.
You can create it by hand using any zip tool as long as you make sure that the folder structure within the zip file follows the war file format.
The best way that I've found to create them (as well as manage all other build operations) is using Apache Ant.
Now, when it comes time to deploy the war file, of course you need a Servlet/JSP engine. Any spec-compliant engine will do (I favor Jakarta Tomcat and Caucho Resin myself).
hth,
bear
[ September 17, 2003: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
And if you want to learn about how to use Ant to make deployable war files you might consider reading my recent series of articles on making web applications in the Java Ranch Newsletter.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
ramdas pradeep kumar
Ranch Hand

Joined: Aug 27, 2003
Posts: 36
I've installed apache-ant.
while executing ant command i got:
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Bad command or file name
please help
Jason Davies
Greenhorn

Joined: Sep 18, 2003
Posts: 14
A .war file simply contains your web application structure.
You should have a directory something like this:
index.html
...
WEB-INF/
WEB-INF/web.xml
WEB-INF/classes/
WEB-INF/classes/Foo.class
...
Then create the .war file using
Read the tutorial links mentioned above for more detail, but the basics are pretty simple.


<a href="http://www.netspade.com/" target="_blank" rel="nofollow">http://www.netspade.com/</a> - Web programming articles and tutorials.
ramdas pradeep kumar
Ranch Hand

Joined: Aug 27, 2003
Posts: 36
is ant is a tool for creating war files?
will ant create xml,web-inf... all these atomatically.?
Jason Davies
Greenhorn

Joined: Sep 18, 2003
Posts: 14
Ant is a Java build tool, similar to make. Ant can be used to create WAR files, only if you have the correct entries in the Ant build.xml configuration file.
In fact you can just use the jar task in one of your targets like this:

The directory structures can also be automatically created. Perhaps you would use something like the following:

Ant is very powerful and can be used for all sorts of things to save you time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to create WAR files
 
Similar Threads
how to create war files
Getting Error while deployement of project in JBOSS
Two war files in a single ear file and each war files has a static variable
Singleton - Diff WAR files - same JVM - instances?
How War file generated