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

Here’s the architecture...

Even though this is a tiny application, we’ll build it using a simple MVC architecture. That way, when it becomes THE hottest site on the web, we’ll be ready to extend the application.

1 - The client makes a request for the form.html page.

2 - The Container retrieves the form.html page.

3 - The Container returns the page to the browser, where the user answers the questions on the form and...

image with no caption

4 - The browser sends the request data to the container.

5 - The Container finds the correct servlet based on the URL, and passes the request to the servlet.

6 - The servlet calls the BeerExpert for help.

7 - The expert class returns an answer, which the servlet adds to the request object.

8 - The servlet forwards the request to the JSP.

9 - The JSP gets the answer from the request object.

10 - The JSP generates a page for the Container.

11 - The container returns the page to the happy user.

image with no caption

Note

From here on out when you don’t see the web server, assume it’s there.

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