Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Introduction to JSP tags JSP Directives

Introduction to JSP tags JSP Directives INTRODUCTION TO JSP TAGS I n this lesson we will learn about the various tags available in JSP with suitable examples. In JSP tags can be devided into 4 different types. These are: Directives In the

Tutorial Details:

directives we can import packages, define error handling pages or the session information of the JSP page.
Declarations
This tag is used for defining the functions and variables to be used in the JSP.
Scriplets
In this tag we can insert any amount of valid java code and these codes are placed in _ jspService method by the JSP engine.
Expressions
We can use this tag to output any data on the generated page. These data are automatically converted to string and printed on the output stream.
Now we will examine each tags in details with examples.
DIRECTIVES
Syntax of JSP directives is:
<%@directive attribute="value" %>
Where directive may be:
page: page is used to provide the information about it.
Example: <%@page language="java" %>
include: include is used to include a file in the JSP page.
Example: <%@ include file="/header.jsp" %>
taglib: taglib is used to use the custom tags in the JSP pages (custom tags allows us to defined our own tags).
Example: <%@ taglib uri="tlds/taglib.tld" prefix="mytag" %>
and attribute may be:
language="java"
This tells the server that the page is using the java language. Current JSP specification supports only java language.
Example: <%@page language="java" %>
extends="mypackage.myclass"
This attribute is used when we want to extend any class. We can use comma(,) to import more than one packages.
Example: <%@page language="java" import="java.sql.*,mypackage.myclass" %>
session="true"
When this value is true session data is available to the JSP page otherwise not. By default this value is true.
Example: <%@page language="java" session="true" %>
errorPage="error.jsp"
errorPage is used to handle the un-handled exceptions in the page.
Example: <%@page language="java" session="true" errorPage="error.jsp" %>
contentType="text/html;charset=ISO-8859-1"
Use this attribute to set the mime type and character set of the JSP.
Example: <%@page language="java" session="true" contentType="text/html;charset=ISO-8859-1" %>


 

Rate Tutorial:
http://www.roseindia.net/jsp/jsptags.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Introduction to JSP tags JSP Directives

View Tutorial:
Introduction to JSP tags JSP Directives

Related Tutorials:

Which JSP book serves up the best lesson?
Which JSP bookAs for Web servers/databases, just mentioning a server in the book is not sufficient to be listed here.
 
Process JSPs effectively with JavaBeans
This articles shows your how you can process JSPs effectively with JavaBeans
 
JSP 2.0: The New Deal, Part 4
JSP 2.0: The New Deal, Part 4 In this final part of the "JSP 2.0: The New Deal" series, we look at two new features that make it much easier to develop custom tag libraries: tag files and the new simplified tag-handler Java API.
 
Introduction to JSP
Introduction to JSP Introduction to JSP Java Server Pages or JSP for short is Sun's solution for developing dynamic web sites. JSP provide excellent server side scripting support for creating database driven web applications. JSP enable the
 
JSP (JavaServer Pages) is a standard for combining Java and HTML to provide dynamic content in web pages.
With JSP, you embed Java code in HTML using special JSP tags similar to HTML tags. You install the JSP page, which has a .jsp extension, into the WebLogic Server document root, just as you would a static HTML page. When WebLogic Server serves a JSP page..
 
JAVASERVER PAGESTM JAVASERVER PAGESTM
JSPTM tag libraries define declarative, modular functionality that can be reused by any JSP page. Tag libraries reduce the necessity to embed large amounts of Java code in JSP pages by moving the functionality provided by the tags into tag implementation
 
JavaServer Pages Technology - Documentation
Sun's tutorial for Java Server Pages that provide a good introduction to design web pages with JSP.
 
JSP Tags
JSP tags do not use <%, but just the < character. A JSP tag is somewhat like an HTML tag. JSP tags can have a "start tag", a "tag body" and an "end tag". The start and end tag both use the tag name, enclosed in < and > characters. The end starts with
 
J2EE pathfinder: Implement JSP custom tags in five easy steps
JSP custom tags provide a standardized mechanism for separating presentation and business logic in a dynamic Web page, allowing page designers to focus on presentation while application developers code the back end. In this installment of J2EE pathfinder,
 
This tutorial shows how to Creating Custom JSP Tag Libraries
JSP 1.1 introduced an extremely valuable new capability: the ability to define you own JSP tags. You Define how the tag, its attributes, and its body are interpreted, then group your tags into collections called tag libraries that can be used in any numbe
 
Advanced Features of JSP Custom Tag Libraries
In this article, the second in the JSP custom tag libraries series, we will cover advanced JSP features and how to use them.
 
Calling JavaBeans from a JSP Page
We will be using this SimpleBean class in this tutorial, so if you haven't read above article then I suggest you do it now.
 
Welcome to the Apache Struts Tutorial
This is the complete Struts Tutorial. Explains ActionForm Action Class Validation Framework.
 

JSP Hosting
 
Introduction to the JSP Java Server Pages
Introduction to the JSP Java Server Pages Welcome to JSP Section Introduction To JSP Java Server Pages or JSP for short is Sun's solution for developing dynamic web sites. JSP provide excellent server side scripting support for creating database
 
Introduction to JSP Declaratives Declarations
Introduction to JSP Declaratives Declarations INTRODUCTION TO JSP DECLARATIVES Syntax of JSP Declaratives are: <%! //java codes %> JSP Declaratives begins with <%! and ends %> with .We can embed any amount of java code in the JSP Declaratives.
 
JSP FUNDAMENTALS
JSP FUNDAMENTALS JSP FUNDAMENTALS By: Hrishikesh Deshpande Introduction : JSP termed as Java Server Pages is a technology introduced by Sun Microsystems Inc. to develop the web application in more efficient way than Servlets. It has got many
 
Introduction to JSP Scriptlets
Introduction to JSP Scriptlets INTRODUCTION TO JSP SCRIPTLETS Syntax of JSP Scriptles are: <% //java codes %> JSP Scriptlets begins with <% and ends %> .We can embed any amount of java code in the JSP Scriptlets. JSP Engine places these code
 
Introduction to JSP tags JSP Directives
Introduction to JSP tags JSP Directives INTRODUCTION TO JSP TAGS I n this lesson we will learn about the various tags available in JSP with suitable examples. In JSP tags can be devided into 4 different types. These are: Directives In the
 
Beginner to advance guide to the Apache Struts
Beginner to advance guide to the Apache Struts The Complete Apache Struts Tutorial This complete reference of Jakarta Struts shows you how to develop Struts applications using ant and deploy on the JBoss Application Server. Ant script is provided
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.