When you create a servlet using the New wizard and place it in a WEB-INF/classes subdirectory, the IDE handles certain tasks for you. These tasks include automatically updating the web module's deployment descriptor to include the servlet and setting certain properties for the servlet. This practice is recommended for developing servlets in the IDE.
If you have an existing servlet class file that you want to add to a web module, a different procedure is required, as shown in the following steps.
To add an existing servlet to a web module:
If you do not process all the items in the Confirm Changes dialog box, you will have to manually add the servlet and servlet-mapping entries to the deployment descriptor (web.xml).
![]() |
If you have a class that extends HttpServlet and the IDE does
not recognize the class as a servlet, right-click the class and choose Tools ![]() |
See Also | |
---|---|
Creating a Servlet Source File Editing a Servlet Source File Servlet Property Sheet About Running Web Modules About Debugging Web Modules About Creating Web Modules |