O'Reilly logo

Core JSTL: Mastering the JSP™ Standard Tag Library by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Iteration Actions

Topics in This Chapter

  • The <c:forEach> Action

  • The <c:forTokens> Action

  • Iteration Status

  • Custom Iteration Actions

In any programming language, the ability to iterate over a set of values is essential. Before JSTL, JSP did not provide an explicit means to accomplish that fundamental task, so developers had two choices: use a scriptlet or implement a custom action, neither of which is very attractive.

JSTL provides two actions that iterate over a set of values: <c:forEach> and <c:forTokens>. JSTL also exposes an interface and two classes that you can use to implement custom iteration actions: LoopTag, LoopTagSupport, and LoopTagStatus, respectively.[1] This chapter describes the <c:forEach> and <c:forTokens> actions and shows ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required