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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.