Java Reference
In-Depth Information
Figure 11.6
IDEA is aware of the context root
of your web application and finds
files accordingly.
application server, so there's no way for
IDEA
to determine with any certainty the
validity of an
HTML
path. If
IDEA
is complaining about paths that you believe to
be valid, chances are your web root is configured incorrectly.
In
IDEA
5.0, reference handling for all web content files is supported.
The new
Extract Include
refactoring lets you select a block of
JSP
code and
extract it into an includable
JSP
fragment that can be reused across multiple
pages. In its place,
IDEA
inserts the appropriate
JSP
tag to include the file. Con-
versely, the
Inline
refactoring does the opposite.
Given an
include
tag, this
refactoring replaces the tag with the contents of the included file.
Working with JavaBeans
Perhaps even more interesting than basic tag completion is the
JSP
editor's sup-
port for JavaBeans. JavaBeans are objects that are stored in the page, request, or
user's session and made available to the
<jsp:getProperty>
and
<jsp:setProp-
erty>
tags. They're placed there through custom tags or through the
<jsp:use-
Bean>
tag.
The
<jsp:useBean>
tag fetches JavaBeans and places them into the page con-
text so that they're available to scriptlets and other tags. When using this tag, you
must specify the class of the JavaBean as well as the scope in which it can be found
(or, rather, the scope it is placed into). For the
class
attribute, you may either type
the fully qualified class name of the JavaBean you wish to make available to the
JSP
page or navigate down by using the basic completion mechanism and select-
ing the appropriate packages, as shown in figure 11.7. Keep in mind that the
JSP
Specification requires that class names be fully qualified. For the
scope
attribute,
Figure 11.7 Completion of class names is restricted to the
Classpath of the web application.