Home

This Chapter
-Chapter 9: The Logic Tag Library
-The Value Comparison Tags
-The Substring Matching Tags
-The Presentation Location Tags
-The Collection Utility Tag
-Summary

Table of Contents
-Introduction
-Chapter 1: Model 2 and Struts
-Chapter 2: Input Validation with Action Forms
-Chapter 3: The HTML Tag Library
-Chapter 4: Input Validation and Data Conversion
-Chapter 5: The Validator Plugin
-Chapter 6: The Expression Language
-Chapter 7: JSTL
-Chapter 8: The Bean Tag Library
-Chapter 9: The Logic Tag Library
-Chapter 10: Struts-EL, Nested, selectLabel
-Chapter 11: Message Handling and Internationalization
-Chapter 12: The Tiles Framework
-Chapter 13: Securing Struts Applications
-Chapter 14: The Config Object
-Chapter 15: The Persistence Layer
-Chapter 16: Object Caching
-Chapter 17: File Upload and File Download
-Chapter 18: Paging and Sorting
-Chapter 19: Preventing Double Submits
-Chapter 20: Early HttpSession Invalidation
-Chapter 21: Decorating Request Objects
-Chapter 22: How Struts Works

Previous
Next

 

Chapter 9

The Logic Tag Library

The Logic Tag Library is one of Struts’ core tag libraries and used to be indispensable. However, it became redundant after the release of JSTL. You are recommended to use JSTL because it is the standard and more powerful than the Logic Tag Library. This chapter is here because the Logic Tag Library is still widely in use and those wanting to migrate to JSTL may need this chapter as a reference.

The tags in the Logic Tag Library fall into the following categories.

All the tags are discussed in this chapter in the following sections.

Note

To reference the Logic Tag Library’s tags indirectly, you need the struts-logic.tld file in your WEB-INF directory and the following taglib element in your web.xml file.

   <taglib>
     <taglib-uri>/tags/struts-logic</taglib-uri>
     <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
   </taglib>

Note

The app09a application provides examples of how to use the tags in the Logic Tag Library. You can run it by using this URL.

   http://localhost:8080/app09a/testLogic.do

Previous
Next