O'Reilly logo

Programming Jakarta Struts, Second Edition by Chuck Cavaness

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required