You can’t remember all
this post-HTML syntax.
Table 18-1 summarizes the syntax of JavaServer
Pages. As the title implies, it contains only the basics; a more
complete syntax can be downloaded from http://java.sun.com/products/jsp/ .
Table 18-1. Basic JSP Syntax
Item
Syntax
Example
Scriptlet
<% code;%>
<% mountain.setHeight(1000); %>
Expression (to print)
<%= expr %>
<%= mountain.getHeight( ) %>
Declaration
<%! decls; %>
<%! int height = 0; %>
Include
<jsp:include page="URL" flush=true />
<jsp:include page="./mountain-list.html" flush=true />
Forward
<jsp:forward page="url"/>
<jsp:forward page="./last-resort.html"/>
Use bean
<jsp:useBean .../>
<jsp:useBean class="x.ClimbBean" id="myClimbBean" scope="page"/>
Set property
<jsp:setProperty ... />
<jsp:setProperty name="myClimbBean" property="*" />
Page directive
<%@ page ... %>
<%@ page import="java.io.*" errorPage="catcher.jsp" %>
Comment
<!-- comment -->
<%!-- This comment appears in HTML -->
Hidden comment
<%-- comment --%>
<%-- This comment is local to JSP --%>
..................Content has been hidden....................
You can't read the all page of ebook, please click
here login for view all page.