- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is a page directive in JSP?
The page directive is used to provide instructions to the container. These instructions pertain to the current JSP page. You may code page directives anywhere in your JSP page. By convention, page directives are coded at the top of the JSP page.
Following is the basic syntax of the page directive −
<%@ page attribute = "value" %>
You can write the XML equivalent of the above syntax as follows −
<jsp:directive.page attribute = "value" />
Attributes
Following table lists out the attributes associated with the page directive −
S.No. | Attribute & Purpose |
---|---|
1 | buffer Specifies a buffering model for the output stream. |
2 | autoFlush Controls the behavior of the servlet output buffer. |
3 | contentType Defines the character encoding scheme. |
4 | errorPage Defines the URL of another JSP that reports on Java unchecked runtime exceptions. |
5 | isErrorPage Indicates if this JSP page is a URL specified by another JSP page's errorPage attribute. |
6 | extends Specifies a superclass that the generated servlet must extend. |
7 | import Specifies a list of packages or classes for use in the JSP as the Java import statement does for Java classes. |
8 | info Defines a string that can be accessed with the servlet's getServletInfo() method. |
9 | isThreadSafe Defines the threading model for the generated servlet. |
10 | language Defines the programming language used in the JSP page. |
11 | session Specifies whether or not the JSP page participates in HTTP sessions |
12 | isELIgnored Specifies whether or not the EL expression within the JSP page will be ignored. |
13 | isScriptingEnabled Determines if the scripting elements are allowed for use. |
- Related Articles
- What are various attributes Of page directive in JSP?
- What is a include directive in JSP?
- What is a taglib directive in JSP?
- What is a page object in JSP?
- What is the purpose of taglib directive in JSP?
- What is JSP page redirection?
- What is the difference between include action and include directive in JSP?
- What is an exception Object in JSP? What type of exceptions can occur in a JSP page?
- Please share a running example of include directive in JSP
- How many types of directive tags JSP supports?
- What is the use of page object in JSP? Need an example.
- Please share one example of using taglib directive in JSP
- How to write a comment in a JSP page?
- How a JSP page works. Can somebody explains the JSP architecture in simpler terms
- What is a pre-processor directive in C#?

Advertisements