JSTL is the JSP Standard Tag Library. The JSTL came abou tunder JSR-52 of the Java Community Process (JCP). The specification can be found at http://jcp.org/jsr/detail/52.jsp.  JSR-52 covers the creation of a standard tag library for JavaServer Pages and allows this library to be available to all compliant JSP containers. These tag libraries provide...

Read More

Although the mechanism of custom tags enabled the creation of libraries to be shared across many different user communities, there are direct benefits to engineers and page authors that can be realized through the use of a standard tag library: ■  It is easy to learn and provides a wide range of functionality. ■  JSP authors and JSP authoring tools ...

Read More

The Core library provides general-purpose actions that get and set scoped variables, write to the JspWriter, and handle catching exceptions. The actions in Core library also take advantage of the expression language features. The XML library addresses the basic needs of a page author as it relates to supporting X...

Read More

There are quite a few implicit objects exposed through the EL. These objects allow for access to any variables that are held in the particular JSP scopes. Objects include pageScope, requestScope, sessionScope, and applicationScope. All of these xScope objects are Maps that map the respective scope attribute names to their values. Using the implicit...

Read More

The  action provides a simple conditional action. If the test condition specified evaluates to true, then the body content is evaluated and the result is written to the current JspWriter. It is possible to save the results of the test condition into an exported scoped variable by specifying the var and scope attributes. In the following exampl...

Read More

When using a mutually exclusive conditional action, only one of the number of possible alternative actions gets its body content evaluated. This is the familiar if/else or if/then/else programming structure. The JSTL actions , , and are used to construct mutually exclusive conditional statements. Note that the and actions are different. A action al...

Read More

Here we are going to change the font color of a table cell depending on the current value of the item. We’ll see this example in the context of the action in just a minute. For now, current is the varStatus attribute, or the current status variable for an iteration, and book is the item attribute in an iteration. Following Example peforms the funct...

Read More

The following example is an implementation of If/Then/Else by  

Read More

There has always been a strong requirement to iterate through collections. In fact, this is probably one of the most common tasks that we need to perform. One can only venture a guess at how many JSP page authors have implemented their own versions of iterating through something. Iterating can certainly be accomplished using scriptlet code in a JSP...

Read More

We have seen throughout some of our previous examples that using the iteration actions makes life a lot simpler for us in JSP-land. The action uses the items attribute to specify a collection of objects. The action then repeats its nested body content over the items. If items is null, then no iteration is performed since it is treated a...

Read More

In this post we have seen how to loop through collection in JSTL. Here we will see how to use conditions while looping through JSTL. Consider we are printing a collection of book in JSP. Now let’s say that when we print the first ten books, we want to highlight the first five. This is done by adding in a collaboration with the conditional action. Read More

While the  action is powerful for iterating, sometimes data is presented to us in the form of strings. A common reason for getting string data (no matter how much we dislike it) is because we are integrating or interfacing with a legacy system. Many times, the data will come in a form where there is some delimiter (or delimiters) being u...

Read More

FOLLOW US ON LinkedIn



Explore Tutu'rself