O'Reilly logo

Struts Kick Start by Kevin Bedell, James Turner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The ActionForm

The JSP pages and ActionForm beans work hand-in-hand in Struts because the JSP submits the user input to the bean, and the bean returns validation errors to the JSP.

To understand how they work together, take a look at one ActionForm and the JSP page it relates to. Listing 7.1 shows the NewUserForm bean, which is the ActionForm for the create account screen of the application.

Note

This file is available on the companion CD with this book.

Listing 7.1. NewUserForm.java
 package stocktrack.struts.form; import javax.servlet.http.*; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionForm; import stocktrack.struts.form.BaseForm; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required