Enter your email address:

Delivered by FeedBurner


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
create a war file using jsp code
12-19-2011, 06:18 PM
Post: #1
Information create a war file using jsp code
Today we are going to learn how to create a war file using jsp code from eclipse and deploy in tomcat,A War is defined as web archive file created specially for running webapplication when you placed an war file in webapps folder of tomcat it is deployed automatically when you start tomcat so lets start now,The "ant tool" is needed to create the war file for that download the ant from In order to view links, you must have to reply to this thread. and create a file named build.xml this xml file must be placed in root of your project folder in eclipse and add the following code in it.

Quote:<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Deploy From Eclipse to Tomcat" basedir=".">
<property name="warfile" value="nameofthewartobecreated"/>
<target name="unpack">
<unwar src="${warfile}.war" dest="${warfile}" />
</target>
<target name="create">
<war destfile="${warfile}.war" webxml="WebContent/WEB-INF/web.xml" update="true">
<classes dir="build\classes"/>
<fileset dir="WebContent">
<exclude name="WEB-INF/web.xml"/>
</fileset>
</war>
</target>
<target name="copy">
<copy todir="C:\Program Files\Apache Software Foundation\Tomcat 5.5\" overwrite="true">
<fileset dir=".">
<include name="*.war"/>
</fileset>
</copy>
</target>
<target name="deploy">
<antcall target="create"/>
<antcall target="copy"/>
</target>
</project>

In eclipse->your projects's build.xml->right click build.xml->Run as->Ant Build->check the needed checkboxes
unpack
copy
create
deploy

click run
You can also use ant tool from command prompt to create the war file ArcGIS Java one of the ant tool available in internet,Now the war is created in your project folder ,Any doubt ask us.

Happy coding.
Find all posts by this user
Add Thank You Quote this message in a reply
Advertise here or at any positions around our site send a mail to info@walkinsforum.com
Post Reply 


[-]
Share/Bookmark (Show All)
Facebook Linkedin Technorati Twitter Digg MySpace Delicious

Possibly Related Threads...
Thread: Author Replies Views: Last Post
Sad how to import a csv file values in to database using jsp rajasri 2 1,211 02-20-2012 12:17 PM
Last Post: rajesh2407
Photo Convert jar to exe file rajasri 3 1,241 02-12-2012 04:55 PM
Last Post: ionutcib
Sad create a file from form input in java,jsp rajasri 0 258 12-19-2011 06:32 PM
Last Post: rajasri
Wink Reading Html code of all the url using java rajasri 0 186 12-19-2011 06:17 PM
Last Post: rajasri
Sad how to delete a file using jsp rajasri 0 265 12-19-2011 06:02 PM
Last Post: rajasri
Photo Tomcat not starting error code 0 rajasri 0 460 12-14-2011 02:04 PM
Last Post: rajasri
Music How to extract war file in java rajasri 0 2,887 12-14-2011 12:07 PM
Last Post: rajasri
Its My Birthday! Dynamic Chart In Jsp/Create chart in jsp Part-1 rajasri 0 819 12-12-2011 11:10 PM
Last Post: rajasri
Photo How to import a war file in to eclipse rajasri 0 1,467 12-12-2011 11:02 PM
Last Post: rajasri
Photo how to add .properties/.jar file to classpath in eclipse rajasri 0 1,548 12-12-2011 07:26 PM
Last Post: rajasri

Forum Jump:


User(s) browsing this thread: 1 Guest(s)