Editing a Servlet

See Also

The IDE provides support for editing Java source files, such as syntax highlighting, Java SE API code completion, automatic formatting, bracket matching, and macros, to name a few of the many features. In addition to the Java support, the IDE provides code completion for the Servlet API. Note that although you can view the servlet that generated from a JSP file by right-clicking the JSP file and choosing View Servlet from the pop-up menu, you cannot edit this servlet.

To edit a servlet source file:

  1. Locate your servlet file in the Projects window or Files window.
  2. Double-click the selected file to open it in the Source Editor.
  3. Edit your file as you would any Java source file, including the use of code completion and editor abbreviations.
  4. Choose File > Save to save your file. Unsaved changes are indicated by an asterisk in the file's tab in the Source Editor.

Note that if you create the servlet outside of the IDE or turn an existing class into a servlet, the IDE may not recognize the file as a servlet. If this is the case, manually register the servlet in the web.xml file.

See Also
About Servlets
Creating a Servlet
Viewing a JSP's Servlet
Adding Java Persistence to a Web Application
Packaging a Resource in a WAR File

Legal Notices