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 Action Class

The Action can be very simple or very complicated. For example, when a user clicks on the create new account button, control is passed to NewAccountAction (shown in Listing 8.1).

Listing 8.1. NewAccountAction.java
 package stocktrack.struts.action; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.*; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionForm; import org.apache.struts.action.Action; /** * stocktrack.struts.action.IndexAction class. * this class used by Struts Framework process the * stocktrack.struts.form.BlankForm form. * - method invoked by HTTP request is perform(....) * - form name is ...

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