Editing a Servlet Source File

The IDE provides support for editing Java source files, such as syntax highlighting, J2SE 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 contextual menu, you cannot edit this servlet.

To edit a servlet source file:

  1. In the Filesystems window locate your servlet file.
  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 and choose 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, right-click the servlet and choose Tools and choose Mark as Servlet from the contextual menu.

tip  To view the Servlet API documentation, choose View and choose Documentation Indices and choose Servlet API Documentation from the main tool bar.
See also
Creating a Servlet Source File
About Running Web Modules
About Debugging Web Modules

Legal Notices