This document outlines one possible sequence of development steps that can be followed to create a Struts application. It is not intended as a complete description of each referenced development activity. More detailed documentation is available elsewhere and is referenced by "(more...)" links where possible.
For those who are short on time and/or patience, you can get a Struts application up and running in a matter of minutes thanks to Maven's archetype feature.
NOTE - as of the time of this writing (10/16/2006), the
specified version in this example has not been released.
Once this has been released, this note can be removed and
the archetype will work fine.
$ cd ~/projects
$ mvn archetype:create \
-DarchetypeGroupId=org.apache.struts \
-DarchetypeArtifactId=struts-archetype-blank \
-DarchetypeVersion=1.3.5 \
-DgroupId=com.example \
-DpackageName=com.example.projectname \
-DartifactId=my-webapp
$ cd my-webapp
$ mvn install
$ mvn jetty:run
ActionForm
descendents to buffer data
between JSPs and Actions.
Action
descendents to respond form
submissions.
struts-config.xml
to associate forms with
actions.
web.xml
to reference
ActionServlet.
html
taglib
to define the form elements.
(more...)message
and other elements from the
bean
taglib to define the labels and other static
text of the form.
(more...)property
attributes to link form fields to
ActionForm
instance variables.
ActionForm
descendents
to buffer data between JSPs and Actions.
<html:text property="city" />needs:
getCity() and setCity(String c)
reset
method
that sets the fields of the
ActionForm
to their default values. Most ActionForms do
not need to do this.
Action
descendents
to respond to form submissions.
execute
method
(or its surrogates) of your Action class to
interface with objects in your
application responsible for database
interaction, such as EJBs, etc.
execute
method
(or its surrogates) direct the user interface
to the appropriate next page.
struts-config.xml
to
associate forms with actions. The file minimally
needs:
web.xml
to
reference
ActionServlet
(more...)junit
tag to launch each TestCase
descendent.
(more...)