JSP Directives

Introduction:

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.Directives provide general information about our Jsp to the Jsp engine These are Translation time instructions to the Jsp engine.

Syntax:

<%@  directive_name  attribute_name = attribute_value %>


There are three types of directive tag.
1.     Page
2.     Include
3.     Taglib
1.Page :  
This is the directive of the JSP page which defines the properties for the entire JSP page by using it's different attributes and set values of the attributes as per requirements.
Syntx:   <%@ page optional attribute ... %>
2. Include :
Include directive is a type of directive tag. If a programmer wants to include contents of a file inside another, then theInclude directive is used. The file included can be either static ( HTML file) or dynamic (i.e., another tag file). Theinclude directive is used to include the contents of other file in the current tag file.
Syntax:      <%@ include file = "xxx.html/xx.tagf">
3.Taglib:
A user can customize actions from their tag file using the Tag Lib directive. The Tag Libdirective is a collection of custom tags.
Syntax<%@ taglib uri = "tag library URI" prefix = "tag Prefix" %>

Thanks For Making This Possible! Kindly Bookmark and Share it.

Technorati Digg This Stumble Stumble Facebook Twitter

No comments:

Post a Comment