JSTL-INTRODUCTION
Introduction :
1. Sun people encapsulated the core functionality which is common to many web applications in the form of JSTL.
2. Programmer can views this predefined Library without writing on his own.
3. The main objective of ExpressionLanguage is removing java code from the Jsp. But it fails to replace java code which processes some functionality like setting attribute in a particular scope.We can fill this gap by using JSTL. Hence the main object of JSTL is also removing the java code from the Jsp.
4. Vendors develop this implementation. It is api specification.Entire JSTL Library divided in to 5 sub parts.
1. Core Library
2. Xml Library
3. Formatting tags
4. Sql Library
5. JSTL Functions
JSTL Description:
Core Library:
The core group of tags is the most frequently used JSTL tags. Following is the syntax to include JSTL Core library in your JSP:
Syntax:
<%@ taglib prefix="c” uri="http://java.sun.com/jsp/jstl/core" %> |
It defines server standard actions to perform programming general stuff like implementing loop and conditional statements. It can also perform Jsp fundamental task like setting attributes, writing output, redirecting the request to other pages etc.
Xml Library:
The JSTL XML tags provide a JSP-centric way of creating and manipulating XML documents. Following is the syntax to include JSTL XML library in your JSP.
The JSTL XML tag library has custom tags for interacting with XML data. This includes parsing XML, transforming XML data, and flow control based on XPath expressions.
Syntax:
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %> |
Before you proceed with the examples, you would need to copy following two XML and XPath related libraries into your <Tomcat Installation Directory>\lib:
XercesImpl.jar: Download it from http://www.apache.org/dist/xerces/j/
It defines several standard actions which can be used for writing, and formatting xml data.
Sql Library:
It defines several standard actions which can be used for data base operation
Syntax:
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %> |
JSTL Functions:
It defines several standard actions which can be used for manipulating collections & string objects.
Syntax:
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> |
Formatting tags:
The JSTL formatting tags are used to format and display text, the date, the time, and numbers for internationalized Web sites. Following is the syntax to include Formatting library in your JSP:
Syntax:
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> |
Ecorptrainings.com provides jstl in hyderabad with best faculties on real time projects. We give the best online trainingamong the jstl in Hyderabad.
ReplyDeleteClassroom Training in Hyderabad India