O'Reilly logo

Head First Servlets and JSP, 2nd Edition by Bert Bates, Bryan Basham, Kathy Sierra

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

Refactoring the Beer app for Struts

Enough theory, let’s write a Struts app. First off, let’s review our MVC Beer app from Chapter 3. The only code that’s going to change when we refactor to Struts is related to the MVC controller. (The model and view are not affected.)

image with no caption

1 Having received a request, the Controller performs validation of the user form data.

2 The Controller invokes the Model component.

3 The Controller forwards to the View.

MVC controller code (from Chapter 3)

image with no caption

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