Skip to main content


Kinetic Community

JSTL Core Tag Library

The JSTL Core tag library contains a number of tags related to variables and flow control, as well as tags for URL management.

Most of flow control tags in the core library rely on EL objects and operators for test conditions. The following links provide some reference information about what is supported. Also take note of the reserved words that cannot be used for variable names.

Getting Started


The JSTL core tag library can be declared with the following taglib directive:

<%-- bundle/initialization.jspf --%>
<%@taglib prefix="c" uri="" %>


<%-- form.jsp --%>
<c:set var="foo" scope="session" value="..."/>


The following tags are provided in the core tag library:


Outputs content to the page. By default the content is escaped if it contains any unsafe HTML characters, such as <>", and &.


Sets the value of an EL variable or property of an EL variable in any of the JSP scopes. If the variable does not already exist, it is created.


Removes an EL variable from the scope it exists in.


Catches any Throwable that occurs in its body and optionally exposes it.


Allows the conditional execution of its body according to the value of the test attribute.


Performs conditional block execution by the embedded when subtags. It renders the body of the first when tag whose test condition evaluates to true. If none of the test conditions of nested when tags evaluates to true, then the body of theotherwise tag is evaluated, if present. This tag behaves much like the Java switch statement.


Used as a subtag within a choose tag. The body of this tag is evaluated if the test condition evaluates to true. This tag behaves much like the Java switch / case statement.


Used as a subtag within a choose tag. The body of this tag is evaluated if all of the when tags evaluate to false. This tag behaves much like the Java switch / default statement.


Used to iterate over a collection of objects. You specify the collection using the items attribute, and the current item is available through a variable named by the var attribute.


Used to iterate over a collection of tokens separated by a delimiter.


Retrieves an absolute or relative URL and exposes its contents to either the page, a String in the var attribute, or a Reader in the varReader attribute. It behaves much like the <jsp:include> tag, but can also be used to access resources from a remote server. The url parameter indicates the location of the resource.


Creates a URL with optional query parameters.


Adds a parameter to a containing import tag’s URL. Automatically URL encodes the parameter value.


Redirects to a new URL.