Chapter 9. Extending the Struts Framework

One of the biggest advantages of using a framework is the ability to extend and customize it based on the needs of the application. The Struts framework is no exception—it provides several very important extension points for developers. This chapter takes a quick glance at some of those extension points and discusses the benefits (as well as a few downsides) of extending the framework.

What Are Extension Points?

Think of a framework as a house that comes with part of the structure already complete, but gives you the option to modify certain characteristics, such as the wallpaper and paint colors. If the default characteristics already suit your needs, you don’t have to change anything. If you like the paint job, for example, that’s one less thing to worry about.

This is similar to how a framework functions, and that’s a big advantage when building applications. If functionality that suits the needs of your application is present in the framework, you don’t have to worry about that aspect of the application. This, in turn, frees up developers to focus on the core application rather than the infrastructure.

This is not a perfect analogy, but the point is that a good framework should provide much of the infrastructure—the foundation and the plumbing, for example. The most important aspect of a framework, however, is that it should provide extension points throughout.

Framework extension points, also referred to as “hooks,” allow you to extend ...

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.