administration mode
Pssst...Ferdy is the creator of JungleDragon, an awesome wildlife community. Visit JungleDragon

 

Article: Tomcat deployer in action »

FERDY CHRISTANT - OCT 22, 2005 (02:55:37 PM)

In my last article on Tomcat, I mentioned the Tomcat Deployer. Tomcat Deployer is a web application that comes with Tomcat5 that allows you to deploy applications without having to restart the server. Below is a short demonstration on how it works.

The first obvious thing is to write your code in your prefered Java IDE. Be sure to stick to the directory structure specified by the J2EE API. The Tomcat application developer guide does a good job of explaining this in an easy way.

Next, you export your project to a WAR (Web ARchive) file. I use Rational Application Developer for all my Java work:


You can of course also use an Ant task to build your WAR files. Once the WAR file is exported, open the Tomcat Deployer at:

http://yourhost:8080/manager/html/list

Scroll down to the "WAR file to deploy" section, select your exported WAR file and click the "Deploy" button:


The Tomcat Deployer will return a message to indicate the status of the deployment:


Next it is time to test the deployment. This obviously completely depends on the structure of your application, or in fact your deployment descripter file (web.xml). I used the most simple HelloWorld project possible. This project contains a helloworld.jsp JSP file that outputs "Hello World". To run it, go to:

http://yourhost:8080/HelloWorldPrj/helloworld.jsp

The HelloWorld project also contains a HelloWorld servlet that outputs "Hello World Servlet". To run it, go to:

http://yourhost:8080/HelloWorldPrj/helloworld

As you can see, using the Tomcat deployer application is easy. It eliminates the need to restart the server each time you deploy an application. You can also remotely deploy applications, without having file system access to the Tomcat server.

You can download my sample HelloWorld WAR file here.

Share |

Comments: 9
Reviews: 4
Average rating: rating
Highest rating: 5
Lowest rating: 1

COMMENT: BEELZEBUB rating

MAY 5, 04:02:12 AM

comment » This is Tomcat Manager not Tomcat Deployer «

COMMENT: DOROTHY VALIGA rating

JUL 25, 06:17:53 PM

comment » Very clear. Very helpful! Thank you! «

COMMENT: NC

NOV 9, 03:24:00 AM

comment » THX for simple, neat instructions 25 «

COMMENT: VASU emailrating

FEB 21, 04:46:08 AM

comment » from scratch itself it was good «

COMMENT: DAVID email

APR 14, 2010 - 02:46:51 PM

comment » The "Tomcat application developer guide" link in the second paragraph here (http://www.ferdychristant.com/blog//articles/DOMM-6HEJCA) is broken. «

COMMENT: ENTERTAINMENT ONLINE emailhomepage

JAN 31, 2013 - 05:37:25 AM

comment » i like to move it «

COMMENT: SIDE ENTERTAINMENT emailhomepage

JAN 31, 2013 - 05:37:43 AM

comment » i like to move it «

COMMENT: HIGH STREET ENTERTAINMENT emailhomepage

JAN 31, 2013 - 05:37:59 AM

comment » i like to move it «

COMMENT: ANDY rating

OCT 13, 2013 - 10:16:04 AM

comment » not helpful «

RATE THIS CONTENT (OPTIONAL)
Was this document useful to you?
 
rating Awesome
rating Good
rating Average
rating Poor
rating Useless
CREATE A NEW COMMENT
required field
required field HTML is not allowed. Hyperlinks will automatically be converted.