Monday, November 21, 2011

Deploying the war

Copy the HelloWorld.war to your Tomcat installation in the /webapps directory.

Tomcat will automatically detect it, explode it, then read the web.xml and will be ready to run it.

Now point your browser to:
http://localhost:8080/HelloWorld/home

And you should see 'Hello World!'

The /HelloWorld in the URL told Tomcat to go to the HelloWorld.war and the /home was resolved to the HelloWorld servlet because of the way we configured the web.xml

Congratulations - you just wrote your first Java web application ;)

No comments: