Registering the servlet
After you compile your servlet, you also need to register the servlet with the web application. To register the servlet, you add two entries to web.xml, which is stored in the following location:
<context root>\WEB-INF
The first entry, under the <servlet> element, defines a name for the servlet and specifies the compiled class that executes the servlet. The following example shows the <servlet> entry for the sample servlet:
<servlet>
  <servlet-name>OdaSampleServlet</servlet-name>
  <servlet-class>
com.actuate.erni.oda.ClassicModels.SampleServlet
</servlet-class>
</servlet>
The second entry, under the <servlet-mapping> element, defines the URL pattern that calls this servlet. The following example shows the <servlet-mapping> entry for the sample servlet:
<servlet-mapping>
  <servlet-name>OdaSampleServlet</servlet-name>
  <url-pattern>/OdaSample</url-pattern>
</servlet-mapping>

Additional Links:

© Copyright OpenText Corp. All rights reserved. Privacy Policy | Cookie Policy

BIRT iHub 2