About Creating and Editing JSP, HTML, and Tag Files

See Also

The JSP Editor shows you the JavaServerTM Pages (JSP) code generated by the IDE for the page you are editing. The JSP code is in XHTML format, and follows standard JSP conventions for the XML representation of a JSP page. The code uses the JavaServer Faces tag libraries to declare components, event handlers, validators, and so on. In addition, there are expressions written in the JavaServer Faces expression language (JSF EL).

Creating and editing JSP, HTML, and tag files is similar to creating and editing Java files. The Source Editor provides support for HTML, JSP, and customized tags, including code completion for the following JSP elements:

Source Editor Features for JSP, HTML, and Tag Files

When you open a JSP or HTML file in the IDE, a Palette (Ctrl-Shift-8) is displayed on the right side of the Source Editor. Code snippets for many of the most common JSP and HTML tags are provided -- grouped according to their function:

To use an item in the Palette, drag it from the Palette into the Source Editor and drop it exactly where you want the tags to appear. A dialog box appears. You can fill in values for the item's standard properties, click OK, and then the IDE generates the tags with your specified values.

The IDE provides smart-case code completion for JSP, HTML, and customized tags. 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 the src folder or from a library that is included in the compilation classpath. 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 included in the compilation classpath.

Other examples of additional JSP support are the highlighting of JSP tags, JSP directives, and EL expressions, code templates, code folding, the display of matching JSP tags, JSP delimiters (<>), and EL delimiters ({}), and code navigation features such as hyperlinking for JSP identifiers. For example, you can jump to the tag source file that defines a tag referenced in a JSP file if you simultaneously hold down the Ctrl key and move the mouse over the tag, as illustrated in Accessing a Custom Tag from a JSP Page.

To format selected code, right-click in the Source Editor and choose Format (Alt-Shift-F) from the pop-up 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 format scriptlets.

See Also
Creating a JSP File
Creating an HTML File
About JSP Character Encoding

Legal Notices