Java Reference
In-Depth Information
Good afternoon!
<%
}
%>
Declarations may also be made within scriptlets and will be recognised within
any subsequent JSP tags on the page.
9.3.5
Comments
These are similar to HTML comments, but are removed from the page before it is
sent to the browser. They commence with <%-- and end with --%> .
Example
<%-- Search algorithm --%>
Such tags are effective for only one line, so multi-line comments necessitate the
repeated use of these tags.
Example
<%-- Search algorithm --%>
<%-- Implements Quicksort --%>
9.3.6
Actions
Action tags perform various functions that extend the standard capabilities of JSPs,
such as making use of JavaBeans. The opening tag specifi es a library and an action
name, separated from each other by a colon. The closing ' > ' is preceded by a for-
ward slash ( ' / ').
Example
<jsp:useBean id="manager" class="staff.Personnel"
scope="session" />
The reference to useBean and associated attributes here indicates the use of a
JavaBean. (There will be extensive coverage of JavaBeans in the next chapter.)
9.4
Implicit JSP Objects
To provide the fl exibility required by dynamic Web sites, a JSP-aware Web server
automatically makes available a number of objects that may be used by JSPs without
explicit declaration. There are nine such objects, as shown in Table 9.1 . These implicit
objects are instances of the classes defi ned by the servlet and JSP specifi cations. The
last three objects are very rarely used. Variable out is also not often required.
Search WWH ::




Custom Search