Web Development

10 JSP tag libraries no programmer should be without


This blog entry is also available as a TechRepublic download.

One of JSP's most overlooked features is its ability to work with reusable code blocks, aka "tag libraries," to add new functionality to a JSP application. These tag libraries, declared using XML-type markup, provide ready-to-use widgets that can easily be integrated into a JSP page. They're also a useful way to separate an application's business logic from its visual presentation.

There are lots of freely available libraries online -- but how do you know where to start? The 10 JSP tag libraries listed in Table A provide a starting point for your journey into the world of JSP reusability. Take a look. Note: To install JSP tag libraries, refer to the documentation and to the installation instructions included with each library.

Table A

Package Name

Description

Standard This library is a must-have, because it incorporates a number of core enhancements to regular JSP. Some of its features include an XML manipulation library, an SQL library, special internationalization capabilities, and support for iterators and other program control mechanisms. Use this library when you need advanced flow control structures, internationalization capabilities, or XML support.
DateTime This library provides various tools for date and time manipulation, including the ability to retrieve the current date and time, generate lists of days and months, format dates and times, and convert between time zones. Use this library to easily bring date and time manipulation routines into your application.
Mailer This library adds e-mail delivery capabilities to your JSP application by including support for sending mail through a user-defined SMTP server. It also includes support for multiple recipients, custom headers, MIME attachments and error handling. Use this library when you need to create and send e-mail messages in a JSP page.
Cache This library provides a simple caching framework for a Web site. It allows you to cache sections of a page and reduce response times by rendering the cached pages to clients. If your site receives a lot of traffic, use this package to reduce server load and page processing time by occasionally providing clients with snapshots from the page cache instead of the "live" page.
XTags This library provides routines to simplify parsing and transforming XML documents with XSLT. It can be used to apply an XSLT transformation to an XML document, add or remove XML nodes, evaluate XPath expressions, and define template rules. Use this library when you need advanced XML/XSLT processing capabilities.
Regexp This library allows you to use Perl5-compatible regular expressions in your JSP applications. The library includes support for Perl's match (m), replace (s) , and split operators. Use this library when you need regular expression support for pattern matching and substitution.
JSP Controls This library allows you to create individual page components, such as login forms or progress bars, which may be independently updated. It is particularly useful for AJAX applications, although it may also be used in non-AJAX mode. Use this library when building AJAX-type JSP applications.
Pager This library implements a paging system for data sets, making it simple to incrementally move forward and backward through large data sets (such as database search results). It also includes various paging styles and support for a browsable result index. Use this library when you need a quick-and-dirty paging system for your application.
JDBForms This library makes it possible to link database connections with form elements and create custom actions to rapidly simplify the development of database-driven Web applications. It includes support for sorting, searching, filtering, and styling and uses a SWING-based interface. Use this library for rapid development of database-backed JSP applications.
Google Tag Library This library makes it possible to perform and process Google searches, check spellings, and access pages in the Google.com cache. Use this package to add Google.com search capabilities to your site or to create a search engine that uses the Google.com database.

4 comments
yvthorre
yvthorre

... "10 JSP tag libraries no Web designer should be without"? ;-) Programmers develop custom tags, Web designers (are supposed to) use them.

edh.tr
edh.tr

Current release for JSP Controls is listed as 0.6, with 1.0 listed on it's roadmap as being planned for 'summer 2006'. Obviously, that didn't happen. No public announcements listed since 2005. Is this project still alive?

obkalu
obkalu

Dude, I agree with you. Web designers are supposed to use the JSP custom tags. But do they really. Yea, that's the way the designers intended the technology to be used. But in reality, it is hardly like that. Do real web designers even care to know about even the basic JSTL tags talkless of going to use them in his page design. Well, i maybe slightly wrong, if i consider that they may use them unknowingly if the tags are embedded/applied in a design tool for them. e.g. Sun Studio Creator or Oracle JDeveloper. Anyways, the programmer typicallly still gets called upon to use his tag by himself.

Editor's Picks