The Address Editing Page

When the address page (see Listing 16.5) is brought up, it displays the fields for the address. One of the nice features of using the Struts html:text tag is that it automatically handles filling in previous values and even does null to empty string conversion. Struts will also do type conversion on the way out, turning a text field into an int, for example.

Listing 16.5. Address.jsp
 <%@ page language="java" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ include file="/jsp/cust/AutoLogin.jsp" %> <% { Customer customer = (Customer) pageContext.getAttribute("customer", PageContext.SESSION_SCOPE); if (( customer == null) || (customer.getEmail() ...

Get MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.