Chapter 7. Developing the application on WebSphere Application Server Community Edition 307
12.Click Next as shown in Figure 7-75.
Figure 7-75 Create Servlet - Deployment Descriptor specific information
308 Migrating from WebSphere Application Server Community Edition to WebSphere Application Server
13.Accept the defaults in the next window, and click Finish to complete the
Servlet generation (Figure 7-76).
Figure 7-76 Create Servlet - Interfaces and Stubs to generate
Chapter 7. Developing the application on WebSphere Application Server Community Edition 309
The generated Java source are shown in the editor, as shown in Figure 7-77.
Figure 7-77 Create Servlet - Generated code
Example 7-7 shows the JavaDoc comment generated for use with XDoclet.
Example 7-7 Servlet annotation
/**
* Servlet implementation class for Servlet: MainServlet
*
* @web.servlet
* name="MainServlet"
* display-name="MainServlet"
* description="web tier entry point servlet"
*
* @web.servlet-mapping
* url-pattern="*.do"
*
* @web.servlet-init-param
310 Migrating from WebSphere Application Server Community Edition to WebSphere Application Server
* name="default_locale"
* value="en_US"
* description="Default locale"
*
*/
14.Double-click Deployment Descriptor: adventure to open the web.xml file
Deployment Descriptor shown in Figure 7-78.
Figure 7-78 Deployment Descriptor
Chapter 7. Developing the application on WebSphere Application Server Community Edition 311
When XDoclet Builder processes the annotation shown in Example 7-7, the XML
related servlet and servlet-mapping is added to web.xml, as shown in
Example 7-8.
Example 7-8 Deployment Descriptor
<servlet>
<description><![CDATA[web tier entry point
servlet]]></description>
<display-name>MainServlet</display-name>
<servlet-name>MainServlet</servlet-name>
<servlet-class>com.sun.j2ee.blueprints.waf.controller.web.MainServlet</
servlet-class>
<init-param>
<description><![CDATA[Default locale]]></description>
<param-name>default_locale</param-name>
<param-value>en_US</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>MainServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

Get Migrating from WebSphere Application Server Community Edition to WebSphere Application Server now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.