Professional Documents
Culture Documents
J S P ™ (JSP™) S: AVA Erver Ages YNTAX Version 1.2
J S P ™ (JSP™) S: AVA Erver Ages YNTAX Version 1.2
J S P ™ (JSP™) S: AVA Erver Ages YNTAX Version 1.2
JSP XML
Legend
All tags are case sensitive. A pair of single quotes is equivalent to a pair of double quotes. Spaces are not allowed between an
equals sign and an attribute value.
Comment Documents the JSP file, but is not <%-- comment --%> No equivalent.
included in the response.
Declaration Declares variables or methods valid <%! declaration; [ declaration; ]+ ... %> <jsp:declaration>
in the page’s scripting language. declaration [ declaration; ]+ ...
</jsp:declaration
Scriptlet Contains a code fragment valid in <% code fragment %> <jsp:scriptlet>
the page’s scripting language. code fragment
</jsp:scriptlet>
JSP XML
Include Directive Includes a file, parsing the file’s JSP <%@ include file="relativeURL" %> <jsp:directive.include file="relativeURLspec" />
elements.
Page Directive Defines attributes that apply to a <%@ page <jsp:directive.page pageDirectiveAttrList /> where
JSP page. [ language="java" ] [ extends="package.class" ]
[ import="{package.class | package.*} , ... " ] pageDirectiveAttrList is the same as the list in the JSP
[ session="true|false" ] column.
[ buffer="none| 8kb|sizekb" ] [ autoFlush="true|false" ]
[ isThreadSafe="true|false" ] [ info="text" ]
[ errorPage="relativeURL" ] [ isErrorPage="true| false" ]
[ contentType="{mimeType [ ; charset=characterSet ] |
text/html ; charset=ISO-8859-1}" ]
[ pageEncoding="{characterSet | ISO-8859-1}" ]
%>
Taglib Directive Defines a tag library and prefix for <%@ taglib uri="URI" prefix="tagPrefix" %> No equivalent. Included in Root
custom tags used in the JSP page.
<tagPrefix:name> Accesses a custom tag’s <tagPrefix:name attribute="value"+ ... /> | <tagPrefix:name attribute="value"+ ... /> |
functionality. <tagPrefix:name attribute="value"+ ... > <tagPrefix:name attribute="value"+ ... >
other tags and data other tags and data
</tagPrefix:name> </tagPrefix:name>
<jsp:forward> Forwards a request to a web <jsp:forward page="{relativeURL | <%= expression %> }" <jsp:forward page="{relativeURL | %= expression % }"
resource. { /> | > [ <jsp:param name="parameterName" { /> | > [ <jsp:param name="parameterName"
value="{parameterValue | <%= expression %>}" /> ] + value="{parameterValue | %= expression %}" /> ] +
</jsp:forward> } </jsp:forward> }
<jsp:getProperty> Inserts the value of a bean property <jsp:getProperty name="beanInstanceName" <jsp:getProperty name="beanInstanceName"
into the result. property="propertyName" /> property="propertyName" />
<jsp:include> Includes a static file or the result <jsp:include page="{relativeURL | <%= expression %>}" <jsp:include page="{relativeURL | %= expression %}"
from another web component. [ flush="true | false" ] [ flush="true | false" ]
{ /> | > [ <jsp:param name="parameterName" { /> | > [ <jsp:param name="parameterName"
value="{parameterValue | <%= expression %>}" /> ] + value="{parameterValue | %= expression %}" /> ] +
</jsp:include> } </jsp:include> }
© 2001 Sun Microsystems, Inc. All rights reserved. Sun, Sun Microsystems, the Sun logo, Java, the Java Coffee Cup logo, JavaServer Pages, and the Duke logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
J AVA S ERVER P AGES ™ (JSP™) S YNTAX version 1.2
Element Description Syntax
JSP XML
© 2001 Sun Microsystems, Inc. All rights reserved. Sun, Sun Microsystems, the Sun logo, Java, the Java Coffee Cup logo, JavaServer Pages, and the Duke logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
J AVA S ERVER P AGES ™ (JSP™) S YNTAX version 1.2
Implicit Objects Type Scope Some Useful Methods (see class or interface for others)
response Subclass of javax.servlet.ServletResponse Page Not typically used by JSP page authors
© 2001 Sun Microsystems, Inc. All rights reserved. Sun, Sun Microsystems, the Sun logo, Java, the Java Coffee Cup logo, JavaServer Pages, and the Duke logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.