Chapter 8. The Controller: Directing the Action


IN THIS CHAPTER

  • The Action Class

  • Accessing the Session and Other Form Beans

  • User Validation and Struts

  • Transferring Control Inside and Outside the Application

  • Conclusions

Getting data back and forth to the user is great, but at some point your code has to actually act on that data and figure out what to do next . This is the job of the Controller.

In Struts, the Controller is implemented in two pieces: the Action classes and Struts itself. The Action receives user input, coordinates access to remote systems or data stores, implements business logic, and decides what View component should be displayed to the user next. Struts, which is configured with the struts-config.xml file, takes care of actually dispatching to that next page.

In this chapter, you'll see how to use the controller to handle control flow and set error conditions related to business logic. You'll also see how to combine data from two forms into a single final action.



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