STRUTS

Page 213

200

Summary

Summary The JSP pages and custom tags should contain only display logic, and this logic should be kept to a bare minimum. Thus, the JSP pages and custom tags should not talk directly to the Model—they only display different pieces of the Model. In essence, they should speak only to the Value object and Data Transfer objects from the Model. Again, the action talks to the Model (typically via Model façade objects) and delegates the display of the Model objects to the View. The Model, in turn, implements the persistence and business rules for the application. Adopting a strict MVC architecture is generally a good idea; it keeps your JSP smaller and more focused. JSPs are harder to test than actions, so adopting MVC increases the liquidity and flexibility of your code base. In addition, as you saw in the testing chapter, dividing your application into layers makes the application easier to test.

Jakarta Struts Live


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.