Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

JSP Directives

By Exforsys | on April 27, 2007 |
JSP Tutorials

JSP Directives

In this JSP tutorial, you will learn about Directive tag with example, page directive, language, extends, import, session and buffer.

Directive tag:

The directive tag gives special information about the page to JSP Engine. This changes the way JSP Engine processes the page. Using directive tag, user can import packages, define error handling pages or session information of JSP page.

General notation of directive tag is as follows:

There are three types of directive tag.

  • page
  • Include
  • Tag Lib

Syntax and usage of directive tag

page directive:

General syntax for the page directive is

<%@ page optional attribute … %>

There are many optional attributes available for page directive. Each of these attributes are used to give special processing information to the JSP Engine changing the way the JSP Engine processes the page. Some of the optional attributes available for page directive are:

  • language
  • extends
  • import
  • session
  • buffer
  • autoFlush
  • isThreadSafe
  • info
  • errorPage
  • IsErrorPage
  • contentType

Syntax and usage of some of the optional attributes available for page directive discussed below.

language:

This attribute is used to denote the language used by a file. Language denotes the scripting language used in scriptlets, declarations, and expressions in the JSP page and any included files.

Syntax of language attribute available for page directive is

<%@ page language = "lang" %>

In the above statement page and language are keywords and one places whatever language the file uses inside " ".

For example if one wants to mention the language as java which is generally mentioned for all it is done as shown below:

<%@ page language = "java" %>

extends:

This is used to signify the fully qualified name of the Super class of the Java class used by the JSP engine for the translated Servlet.

Syntax of extends attribute available for page directive is

<%@ page extends = "package.class"%>

In the above statement page and extends are keywords.

import:

The import attribute is used to import all the classes in a java package into the current JSP page. With this facility, the JSP page can use other java classes.

Syntax of import attribute available for page directive is 

<%@ page import = "java.util.*" %>

In the above statement page and import are keywords.

If there are many Java packages that the JSP page wants to import, the programmer can use import more than once in a JSP page or separate the Java packages with commas, as shown below:

<%@ page import="{package.class | package.*}, …" %> 

session:

The session attribute, when set to true, sets the page to make use of sessions.

NOTE: by default, the session attribute value is set to true therefore, all JSP pages have session data available. If the user sets the session attribute to false, it should be performed in this section. When the session attribution is set to false, the user cannot use the session object, or a <jsp:useBean> element with scope=session in the JSP page which, if used, would give error.

Syntax of session attribute available for page directive is 

<%@ page session="true|false" %> 

In the above statement page and session are keywords. And either true or false value can be setted and by default the value is true.

buffer:

If a programmer likes to control the use of buffered output for a JSP page then the buffer attribute can be made use of for achieving this.

Syntax of buffer attribute available for page directive is 

<%@ page buffer = "none|8kb|sizekb" %>  

In the above statement page and buffer are keywords. The size of buffer size is mentioned in kilobytes.  This is used by the out object to handle output sent from the compiled JSP page to the client web browser. The default value is 8kb. If a user specifies a buffer size then the output is buffered with at least the size mentioned by the user.

For example one can specify as:

<%@ page buffer = "none" %>

« « How Web 2.0 Will Change The Internet
JSP Page Directive » »

Author Description

Avatar

Editorial Team at Exforsys is a team of IT Consulting and Training team led by Chandra Vennapoosa.

Free Training

RSSSubscribe 392 Followers
  • Popular
  • Recent
  • JSP Directive Tag and Scriptlet tag

    April 28, 2007 - 0 Comment
  • Sell CC Fresh Visa,MasterCard,American Express,Discover All Country

    May 3, 2007 - 0 Comment
  • JSP Request Object

    May 7, 2007 - 0 Comment
  • JSP Implicit and Session Objects

    May 4, 2007 - 0 Comment
  • JSP Response Object

    May 8, 2007 - 0 Comment
  • JSP Architecture

    April 29, 2007 - 0 Comment
  • Working with JSP Sessions

    April 18, 2010 - 0 Comment
  • JSP Introduction

    April 27, 2007 - 0 Comment
  • JSP Out Object

    May 5, 2007 - 0 Comment
  • JSP Environment Setup

    April 27, 2007 - 0 Comment
  • Working with JSP Sessions

    April 18, 2010 - 0 Comment
  • JSP Response Object

    May 8, 2007 - 0 Comment
  • JSP Request Object

    May 7, 2007 - 0 Comment
  • JSP Out Object

    May 5, 2007 - 0 Comment
  • JSP Application Object

    May 5, 2007 - 0 Comment
  • JSP Implicit and Session Objects

    May 4, 2007 - 0 Comment
  • Sell CC Fresh Visa,MasterCard,American Express,Discover All Country

    May 3, 2007 - 0 Comment
  • JSP Architecture

    April 29, 2007 - 0 Comment
  • JSP Page Directive

    April 28, 2007 - 0 Comment
  • JSP Directive Tag and Scriptlet tag

    April 28, 2007 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • Working with JSP Sessions
  • JSP Response Object
  • JSP Request Object
  • JSP Out Object
  • JSP Application Object

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2023. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT