Chapter 13. Struts and Enterprise JavaBeans

As you’ve seen so far, you can use Struts to build both the controller and the view components of an MVC-based application. Struts isn’t a framework for business logic or data access, so it doesn’t play a key role in the model component. This means that business logic (other than presentation validation) would be out of place in an action or form class. It also means that choosing to use Struts in an application shouldn’t place any constraints on the design of the model. The separation of responsibilities in a layered architecture means that your Struts classes shouldn’t care about how your model is implemented. Likewise, the model shouldn’t care (or even know) that the controller and view are built using Struts.

Up to this point, the example applications presented in this book have used the web tier to provide everything needed from the middle tier, including the business logic and database access. With this approach, the application model has consisted simply of regular Java classes deployed in the web container. These classes have had complete responsibility for servicing requests from the action classes that depend on the application model. This architecture is common among web applications, and it works well as long as the requirements in areas such as security, scalability, and transaction complexity stay within the limits of what a web container can do. Trying to do everything within the web tier can prove to be a challenge when ...

Get Programming Jakarta Struts, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.