Two-Step Forms
The credit card code shows how you can implement a form that is filled out in two steps. The first page (see Listing 16.8) looks much like the Address.jsp code, letting the user fill out or edit the credit card information.
Listing 16.8. CreditCard.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() == null)) { response.sendRedirect("Login.jsp"); return; } } %> <html:html> <head> <title> <bean:message key="mycard.title"/> </title> <%@ include ... |
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.