Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Jstl Installing JSTL,Downloading JSTL, Installing JSTL

Related Tutorials


 
 

Share on Google+Share on Google+

Installing JSTL,Downloading JSTL, Installing JSTL

Advertisement
This page discusses - Installing JSTL,Downloading JSTL, Installing JSTL

Installing JSTL

Different installation procedure has to be followed for Tomcat 4.x and Tomcat 5.x Containers. To use JSTL two files jstl.jar and standart.jar are required to be placed into WEB-INF/lib directory of the web application. Each web application must have this file. With Tomcat 5.0 these files can be copied from the examples folder webapps/jsp-examples/WEB-INF/lib/ folder.

JSTL Installation on Tomcat 4.1

This differs from Tomcat 5.0.x installation, as the tld files have to be copied in application folder at a particular location and entries for these

  1. Download the JSTL archive (binaries not source) from the Jakarta Website. Unzip/untar the file.
  2. Copy the jar files you've extracted to common/lib in your Tomcat installation (although you won't need all the jar files for our project). This makes the JSTL jar files available to any of your Web applications.
  3. For any Web application for which you want to use JSTL, copy the .tld files to the WEB-INF directory in your Web application.
  4. For your JSTL Web application, edit your web.xml file and add the following entries:
<taglib>
    <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
    <taglib-location>/WEB-INF/fmt.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
    <taglib-location>/WEB-INF/c.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
    <taglib-location>/WEB-INF/sql.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
    <taglib-location>/WEB-INF/x.tld</taglib-location>
  </taglib>

There are two versions of JSTL, each with their own URI.

For JSP1.2 Containers: (e.g. Tomcat 4)
JSTL1.0: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

For JSP2.0 Containers: (e.g. Tomcat 5)
JSTL1.1: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


Make sure you have installed the right version for your server, and are using the correct uri.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 18, 2011

Related Tutorials

Discuss: Installing JSTL,Downloading JSTL, Installing JSTL  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
Viki
December 10, 2012
JSTL tutorial

Very bad tutorial! First the link lead me nowhere, second - you don't have to write anything in the web.xml in order to make jstl work. You just need to put the JSTL jar files in the webapp/lib and to use the taglib tag in the jsp pages where you need to write jstl code!
DMCA.com