SE452: JSP Directives [6/12] ![]() ![]() ![]() |
Directives are page dependent properties that are passed on to the JSP container
3 Types
Syntax:<%@ directive { attr="value" }* %>
Page
Syntax:<%@ page page_directive_attr_list %>
page_directive_attr_list ::= { language="java"}
{ extends="className" } - JSP base class
{ import="importList" }
-java.lang.*, javax.servlet.*, javax.servlet.jsp.* and javax.servlet.http.*
{ session="true|false" }
- whether the page participates in a session
{ buffer="none| 8kb |sizekb" }
{ autoFlush="true|false" }
-illegal to make buffer = none when autoflush is false
{ isThreadSafe="true|false" }
{ info="info_text" }
{ errorPage="error_url" }
{ isErrorPage="true|false" }
{ contentType="ctinfo" } - "text/html"
{ pageEncoding="peinfo" } - "ISO-8859-1"
Taglib
Syntax:<%@ taglib uri="tagLibraryURI" prefix="tagPrefix" %>
Example:
<%@ taglib uri="http://www.mycompany.com/supertags" prefix="myco" />
...
<myco:TagName>
...
</myco:TagName>
Include
Syntax:<%@ include file="relativeURLspec" %>
Example:
<%@ include file="copyright.html" %>
Requests the inclusion of the file at translation time