Java Reference
In-Depth Information
The steps necessary to package the application for deployment are the following:
1.
Copy the WAR file under the Web application root of the servlet container.
2.
When installing the WAR file, optionally we can add a new context (in order for the
servlet container to properly recognize our application) to the server.xml file (located at
<TOMCAT_HOME>/conf/server.xml ). This is not necessary if the application is placed in
the Webapps directory and uses standard defaults. We will skip this step, assuming the
standard situation.
3.
Having done so, it is enough to launch the servlet container, and test the servlet using an
URL compliant with that described in Listing 5.12.
L ISTING 5.12 The Web.xml Web Application Deployment Descriptor File
<?xml version=”1.0” encoding=”ISO-8859-1”?>
<!DOCTYPE Web-app
PUBLIC “-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN”
“http://java.sun.com/j2ee/dtds/Web-app_2_2.dtd”>
<Web-app>
<servlet>
<servlet-name>
license1
</servlet-name>
<servlet-class>
com.marinilli.b2.c5.LicenseServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
license1
</servlet-name>
<url-pattern>
/midp/*
</url-pattern>
</servlet-mapping>
</Web-app>
Refer to Listing 5.4 for details on the corresponding client for this server application.
Search WWH ::




Custom Search