Enhancing JSP Functionality
with JSTL and Custom Tags
In the previous chapter, we covered how to write applications using Servlets
and JSPs using NetBeans. In this chapter we will see how NetBeans allows us to
easily use the JSP Standard Tag Library (JSTL) to build JSPs that are readable and
maintainable, by relying less on JSP scriptlets.
The topics covered in this chapter include:
• NetBeans support for Core JSTL tags that, among other things, allows to
implement conditional logic and loops in JSPs without resorting to scriptlets
• NetBeans support for SQL JSTL tags that allow us to insert, retrieve, or
update data in a relational database
• Using NetBeans to create JSP tags that can help us create more maintainable
JSPs by abstracting common markup into a single file
The Java Standard Tag Library ( JSTL ) allows us to add functionality to our pages
without having to rely on scriptlets, that tend to create pages that are hard to
Core JSTL tags allow us to control how pages are displayed, for example, by
conditionally rendering segments of the page or iterating through a collection of
objects to dynamically generate markup from said collection.
SQL JSTL tags allow us to access a database and run SQL queries by simply adding
some tags to our JSPs.
Since using JSTL allows us to avoid scriptlets, our pages become more maintainable
and easier to read. NetBeans allows us to use both Core JSTL tags and SQL JSTL tags
by simply dragging items from the NetBeans palette into our JSPs.