LESSONS
There are a lot of resources available to help you learn Struts. The purpose of these beginning lessons is not to teach you the foundations of Struts or to provide detailed explanations of all the components and functionality. To really get a good grasp of the Struts framework I highly recommend the new user dig into a few of the great
books available and look over the links in the resources section.
One thing I found a bit difficult to find were some very watered down tutorials to help the real newbie see how the different struts components fit together. There are some great example Struts applications out there but they often don't explain the process of how the application was built. This is understandable of course since there really is no set order in which the components of a web application have to be built. None the less, I believe many will find it helpful to have some step-by-step explanations to creating a Struts application. A step-by-step approach should give you a good feel for how the different Struts pieces interact.
Each of these early lessons attempts to hold your hand through the development process of building very basic Struts applications. Each lesson will have you build the same application, but rather than cram everything into one example, each successive lesson adds some new features. The idea is to not overwhelm you with all Struts has to offer, but to provide very simple lessons that break up the learning into small, easy to understand pieces.
Hopefully you will find these lessons useful. If you find any errors or have any comments or suggestions please
e-mail me.
Thanks...
Clay Ashby, Dennis Lindeman, Philippe Huynh Vinh Phat for the typos/mistakes they brought to my attention.
Ben Engbers for converting the lessons into PDFs.
Now go Strut your stuff! :)
- - -
Rick Reumann
The Lessons:
Each of the lessons can stand alone, but they assume you understand the principles taught in the previous lessons.
Lesson I
Concepts introduced:
Setting up your environment
Data Transfer Object
ActionForm
web.xml
struts-config.xml
ApplicationResources.properties
BeanUtils
Tag usage
Lesson II
Concepts introduced:
Validation (in ActionForm)
ErrorMessages
ActionMessages
Pre-poluation of form
Dealing with Errors thrown in Actions
html:select and html:options tag
Lesson III
Concepts introduced:
DynaActionForm (DynaValidatorForm)
Declarative Exception Handling
Validation made easy
html:multibox tag
Struts and iBATIS
Some comments on components used in an application using iBATIS for database persistence. Downloadable zip archive with source code included.