Chapter 8. The Controller: Directing the Action

IN THIS CHAPTER

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset