Implicit Objects:
Object | Description |
---|---|
request | This is the HttpServletRequest object associated with the request. |
response | This is the HttpServletResponse object associated with the response to the client. |
out | This is the PrintWriter object used to send output to the client. |
session | This is the HttpSession object associated with the request. |
application | This is the ServletContext object associated with application context. |
config | This is the ServletConfig object associated with the page. |
pageContext | This encapsulates use of server-specific features like higher performance JspWriters. |
page | This is simply a synonym for this, and is used to call the methods defined by the translated servlet class. |
Exception | The Exception object allows the exception data to be accessed by designated JSP. |
JSP Directives:
<%@ directive attribute="value" %>
Directive | Description |
---|---|
<%@ page ... %> | Defines page-dependent attributes, such as scripting language, error page, and buffering requirements. |
<%@ include ... %> | Includes a file during the translation phase. |
<%@ taglib ... %> | Declares a tag library, containing custom actions, used in the page |
Attributes:
Following is the list of attributes associated with page directive:
Attribute | Purpose |
---|---|
buffer | Specifies a buffering model for the output stream. |
autoFlush | Controls the behavior of the servlet output buffer. |
contentType | Defines the character encoding scheme. |
errorPage | Defines the URL of another JSP that reports on Java unchecked runtime exceptions. |
isErrorPage | Indicates if this JSP page is a URL specified by another JSP page's errorPage attribute. |
extends | Specifies a superclass that the generated servlet must extend |
import | Specifies a list of packages or classes for use in the JSP as the Java import statement does for Java classes. |
info | Defines a string that can be accessed with the servlet's getServletInfo() method. |
isThreadSafe | Defines the threading model for the generated servlet. |
language | Defines the programming language used in the JSP page. |
session | Specifies whether or not the JSP page participates in HTTP sessions |
isELIgnored | Specifies whether or not EL expression within the JSP page will be ignored. |
isScriptingEnabled | Determines if scripting elements are allowed for use. |
<%@ page buffer="16kb" autoFlush="true" contentType="text/xml" errorPage="MyErrorPage.jsp" import="java.sql.*,java.util.*" language="java" session="true"%>
<%@ page buffer="none" autoFlush="false" contentType="application/msword" isErrorPage="true" info="test" isThreadSafe="false" isELIgnored="false" isScriptingEnabled="false"%>
<%@ include file="webAnalytics.jsp" %>
No comments:
Post a Comment