Using JSTL

JSTL tags can be used to replace much of the Java scriptlets in JSP. JSTL tags are classified in five broad groups:

  • Core: Covers flow control and variable support among other things
  • XML: Tags to process XML documents
  • i18n: Tags to support internationalization
  • SQL: Tags to access database
  • Functions: Tags to perform some of the common string operations

We will modify the login JSP to use JSTL, so that there are no Java scriptlets in it:

  1. Download JSTL libraries for APIs and their implementation. At the time of writing, the latest .jar files are javax.servlet.jsp.jstl-api-1.2.1.jar (http://search.maven.org/remotecontent?filepath=javax/servlet/jsp/jstl/javax.servlet.jsp.jstl-api/1.2.1/javax.servlet.jsp.jstl-api-1.2.1.jar ...

Get Java EE 8 Development with Eclipse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.