JSTL Functions Reference and Examples
- Details
- Written by Nam Ha Minh
- Last Updated on 26 July 2019   |   Print Email
Table of Contents:
- Introduction to JSTL Functions
- JSTL Functions Reference and Examples
- Sample Project – JSTL-Functions-Reference Structure
- Downloads
Introduction to JSTL Functions
JSTL Functions allow to do common tasks like searching for a string in another string, checking whether a particular string starts or ends with a specified string or finding out an index of a string within another string etc. To use JSTL Functions we need to include JSTL Functions tag library in our JSP as shown below:
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>The following section discusses about JSTL Functions in details along with working examples.JSTL Functions Reference and Examples
Sample Project – JSTL-Functions-Reference Structure
The sample Eclipse project contains all the working code examples from this article. If you have downloaded and deployed the JSTL-Functions-Reference .war file, the starting point would have been index.jsp. You can access the index.jsp by the URL http://localhost:8080/JSTL-Functions-Reference/index.jsp assuming you’ve deployed the .war file to a container like Tomcat.
Once the web application is deployed, up and running, you can click on each link to see the working example of the individual JSTL functions. All the JSP files demonstrating JSTL functions are organized into the folder jstl-functions. The project structure is shown below:
Comments
Message An exception occurred processing [default.jsp] at line [21]
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: An exception occurred processing [default.jsp] at line [21]
18: url="http://localhost:8080/first/citizen-template.xsl" var="xsltTemplate"/>
19:
21:
22:
23: