Expert Spring MVC and Web Flow

(Dana P.) #1




value="${status.value}" />



This tag file encapsulates the printing of the table row, checking whether the field has an
error, and filling out the tag’s attribute values. It can also handle both text and pass-
word fields by specifying the type attribute, though textis the default.
This tag file can be improved upon, based on your flexibility needs. For instance, the
name and path attributes might be considered redundant if you already have a translation of
the path attribute in your messages file. You may consider passing the path attribute value
into the tag to get the current locale’s translation for the field name.
Let’s put it all together and use these helpful new tag files in our original JSP file, modified
in Listing 6-69.


Listing 6-69.Page 1: JSP File with Tag Files


<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="tag" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">





Create an Account
" type="text/css" />


Create an Account









CHAPTER 6 ■THE CONTROLLER MENAGERIE 187
Free download pdf