Jetty web server - It should be obvious from looking at the

It should be obvious from looking at the tags included with JSTL that not all of the Struts tags are being replaced. The tags within the HTML tag library in particular will be around for some time. 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. 9.1 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 the framework in specific places to adapt it to meet the application’s requirements. Where and how a framework provides these hooks is very important. If they’re provided incorrectly or in the wrong locations, it becomes very hard for an application to adapt the framework, which makes the framework less useful. The rest of this chapter focuses on where the Struts framework provides these extension points and how you can take advantage of them to build out specialized functionality for your application. 9.2 General Extension Points This section discusses some extension points that affect the overall framework, not necessarily one particular layer. Arguably the most important of these is the PlugIn mechanism. 9.2.1 Using the PlugIn Mechanism The Struts framework provides a mechanism to allow components to be plugged in and loaded dynamically. This feature was added in Version 1.1 and is supported through the use of the org.apache.struts.action.PlugIn interface. Any Java class can function as a plug-in, as long as it implements the PlugIn interface. A plug-in is simply any Java class that you need to initialize when the Struts application starts up, and destroy when the application shuts down. The PlugIn interface contains two methods, as shown in Example 9-1.
We recommend high quality webhost to host and run your jsp application: christian web host services.

Leave a Reply