The ActionForm

When one of the Submit buttons is hit, the controller looks up the name of the requested ACTION in the struts-config.xml file. In this case, it finds that the page requested /myAccount and therefore needs to store any form data into accountForm (see Listing 16.3) through introspection. accountForm just holds the values in normal bean property fashion.

Listing 16.3. accountForm.java
 package com.bfg.struts; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; public class accountForm extends ActionForm { protected String action; protected String cardIndex; protected int addressIndex; public void setAction(String ...

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.