Chapter 3. Hello World: A First Struts Application


Chapter 3. Hello World!: A First Struts Application

IN THIS CHAPTER

  • Hello World! Application Requirements

  • Applying the Model-View-Controller Pattern

  • The View Component: The HTML Form and the Form Bean

  • MessageResources and Application.properties Files

  • The Struts Form Bean: HelloForm.java

  • Data Validation and ActionError s

  • The Controller Component: HelloAction.java

  • The Model Component ( HelloModel.java )

  • Passing Data to the View Using Attributes: Constants.java

  • Tying It All Together: The struts-config.xml File

  • Conclusions

This chapter provides a rapid introduction to Struts by building a complete ”although basic ”application from scratch. The goal of this chapter is to enable a competent developer to quickly grasp all the basics of how to build Struts applications.

The chapter continues the longstanding tradition of developing a first program in a new language that simply prints Hello World! . This enables developers to quickly grasp the fundamentals of how the program works without forcing them to think too much about the application requirements. To demonstrate some of the important features of Struts, however, the application built here will have a few additional features.

Development of a sample application will be covered including:

  • Application requirements

  • Using the Model-View-Controller pattern to design a solution using Struts

  • The View component: The HTML form and the form bean

  • MessageResources and Application.properties files

  • The Struts form bean: HelloForm.java

  • Data validation and using ActionError s

  • The Controller component: HelloAction.java

  • The Model component: HelloModel.java

  • Passing data to the View using attributes: Constants.java

  • Tying it all together: struts-config.xml



Struts Kick Start
Struts Kick Start
ISBN: 0672324725
EAN: 2147483647
Year: 2002
Pages: 177

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net