Chapter 18. Web Frameworks

This chapter introduces you to the world of frameworks. It first defines what a framework is and explains why they are desirable in your application development.

The chapter then introduces some available frameworks that you can use and explains their basic structure. This chapter will prepare you for the next chapter, which explains a Web framework in significantly more detail. Of course, this chapter assumes you have followed the steps outlined in Chapter 1, "Getting Started with JavaServer Pages," about setting up Tomcat and your development environment.

This chapter covers the following topics:

  • A general definition of frameworks

  • Why frameworks are generally considered a good practice

  • Different types of Web frameworks

  • An example using the WebWork framework

  • An example using the MVC components of the Spring framework

This chapter will prepare you for Chapter 19 on the Struts framework and Chapter 20 on the Tiles framework.

What Is a Framework?

As programmers, we can generally define what we do as solving problems. Every problem has one or many solutions that we might implement to achieve our goals. (Few problems have no solution!) These solutions can vary in any number of ways—from their complexity to their general architecture.

Problems to be solved exist at all levels of software development, from figuring out how to structure an application to choosing between a for-loop and a while-loop. Different programmers will typically solve a problem differently. Give ...

Get Beginning JavaServer Pages™ 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.