Java Reference
In-Depth Information
Figure 11.5 Code completion is enabled in JSPs, even completion of non-Java
code. This figure shows an example of code-completing a JSP tag.
Complete Code | Class Name
, or
Ctrl+Alt+Space
) are available when you're
working with directives, their attributes, and their attribute values; SmartType
code completion (
Code | Complete Code | SmartType
, or
Ctrl+Shift+Space
) is
available in a scriptlet. As shown in figure 11.5,
IDEA
helps you select the
attributes of any of the
JSP
commands. As you'll learn shortly, it also helps com-
plete custom tags and references to JavaBeans.
When you're working with a
JSP
tag, you can use the
View | Parameter
Info
command (
Ctrl+P
) to see an overview of the tag's attribute options.
The list of supported attributes appears in a pop-up window. Attributes
listed in bold are required, and optional elements are listed in a normal
font. Any attributes already present in the tag are shown in gray.
TIP
JSP includes
IDEA
recognizes relative file references in your
JSP
s. When you deploy a web applica-
tion, remember that
JSP
URL
s in it are relative to the context path of the application.
So, when you include a file via the
<jsp:include>
tag,
IDEA
can use your web
application root settings to verify the path reference for you. It even lets you edit
the included file by using the
Go To | Declaration
(
Ctrl+B
) function when you're
in the
page
attribute. In figure 11.6,
IDEA
is showing off its ability to complete the
value of the page by finding all the
JSP
files in the specified directory.
Note, however, that this convenience only applies to path references in your
JSP
code, not references in
HTML
such as anchor tags, links, or image references.
A web application can be deployed under any context (top-level path) on the