Editing a JSP File

See Also

Editing standard JSP files is similar to editing HTML, and the Source Editor provides support for both HTML and JSP tags. Editing JSP documents is similar to editing XML. The IDE provides additional support for JSP syntax, including code completion for the following elements:

The IDE provides smart-case code completion for HTML. When you start writing a tag, the IDE offers code completion in upper case or lower case, depending on the case you are using.

tip  To enable code completion for a JavaBean class, the JSP file must have a valid jsp:useBean directive, the class must be in a package, and the class must be available from either the WEB-INF/classes directory tree or from a library in the WEB-INF/lib directory. To enable code completion for tags in tag libraries, the JSP file must have a valid taglib directive for the library and the library must be in the WEB-INF/lib directory.

Other examples of additional JSP support are the highlighting of JSP tags, JSP directives, and EL expressions, and the display of matching JSP tags, JSP delimiters (<>), and EL delimiters ({}).

To reformat selected code, right-click in the Source Editor and choose Reformat Code from the contextual menu. If no code is selected, the IDE acts as if the whole file has been selected. The IDE indents nested tags only if both the start and end parent tags are in the selected area. Note that this action does not reformat scriptlets.

To edit a JSP file:

  1. In the Filesystems window, locate your JSP file.
  2. Double-click the selected file to open it in the Source Editor.
  3. Edit your file as you would any HTML 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.

See also
Creating a JSP File
About JSP Syntax
Validating JSP Syntax
About Debugging Web Modules
Viewing a JSP's Servlet

Legal Notices