What is JSTL?

  •  JSTL is used to avoid java coding in JSP.
  • The JavaScript pages standard Library(JSTL) encapsulates core functionality common to many JSP applications .
  • JSTL has core tags for iterators,conditionals for handling flow control,etc,formatting tags for supporting internationlaization,tags for accessing database using SQL,tags for manipulating XML documents, and tags for commonly used functions.
  • The JSTL tags are classified according to their functionality. The UEI,s for the libraries as follows

 

1.JSTL core tags

<%@tagliburi=”http://java.sun.com/jsp/jstl/core” prefix=”c”%>

2.JSTL formatting tags

<%@tagliburi=”http://java.sun.com/jsp/jstl/fmt” prefix=”fmt”%>

3.JSTL SQL tags

<%@tagliburi=”http://java.sun.com/jsp/jstl/sql” prefix=”sql”%>

4JSTL XML/XSL tags

<%@tagliburi=”http://java.sun.com/jsp/jstl/xml” prefix=”x”%>

5.JSTL function tags

<%@tagliburi=”http://java.sun.com/jsp/jstl/functions” prefix=”fn”%>

  • To use the JSTL core tags in JSP we need to do the folowing two steps.

step1:Use the <taglib>directive in the JSP

<%@tagliburi=”http://java.sun.com/jsp/jstl/core” prefix=”something”%>

step2:Add jstl.jar and standard.jar to lib folder of your web application.The location of these two jars is present in apache-tomcat\webapps\examples\WEB-INF\lib folder

Groupings of Actions

In all, there are fourteen actions contained in the JSTL core library. This table briefly summarizes the actions in each group.

Groups Action Purpose
General Purpose <c:out>

<c:set>

<c:remove>

<c:catch>

Manipulating attributes, controlling

output to the JSPWriter, catching

exceptions

Conditional <c:if>

<c:choose>

<c:when>

<c:otherwise>

Control flow (branching)
Iteration <c:forEach>

<c:forTokens>

Control flow (looping)
URL-Related <c:import>

<c:url>

<c:redirect>

<c:param>

Use of other resources

 

 

January 14, 2016

0 responses on "JSTL"

Leave a Message

Your email address will not be published. Required fields are marked *

About Us

Pradeep Academy is an online & Training institute To make learning easy, interesting, affordable and accessible to millions of learners across the Globe.
To create an alternative learning platform, using a unique learning methodology of live online interactive courses along with 24x7 support. We aim to empower our customers with skills which will help them get an edge in their careers and improve their lives.

Contact Us

Address :

#Hosabelaku Building, 3417/13, Near TTMC Bus Stop,, 30 Feet Service Road,

Vijaya Nagar, Bengaluru, Karnataka 560040
Email : [email protected]
Ph No: +91 8660907231
Web: https://academy.pradeepit.com
top
© Pradeep Academy.  Design & Developed by