JSTL Core Tags

JSTL(JSP Standard Tag Library) is a collection of custom tags that provide common functionalities like flow control, database operations, etc. JSTL tags can be embedded in Java Server Pages just like other HTML tags. It is convenient for front-end developers to work with HTML-like tags for including logic in webpages rather than writing Java code in scripts. To use JSTL tags, the following dependencies must be included in pom.xml in a maven project:

XML

< groupId >javax.servlet

Alternatively, you can download the jar files from this link. JSTL tags are grouped into five major categories:

  1. Core Tags
  2. Formatting Tags
  3. SQL Tags
  4. XML Tags
  5. Function Tags

This article focuses on JSTL Core tags.

JSTL Core Tags

Core tags in JSTL are used for iteration, conditional logic, url management, handling exceptions, redirect, etc.

The following tags are included in the JSTL Core tag library:

c:set

It is used to set a value to a variable that can be used within the specified scope in a JSP.