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

Create the JSP “view” that gives the advice

Don’t get your hopes up. You’re going to have to wait for a few chapters before we really start talking about JSPs. This JSP isn’t actually a particularly good one, either (because of its scriptlet code, which we’ll talk about later in the book). For now it should be pretty easy to read, and if you want to experiment a little, go for it. Although we could test this JSP now from the browser, we’ll wait until after we modify the servlet (version three) to see if it works.

Here’s the JSP...

image with no caption

Deploying the JSP

We don’t compile the JSP (the Container does that at first request). But we do have to:

1 - Name it “result.jsp”.

2 - Save it in the development environment, in: /web/.

3 - Move a copy of it to the deployment environment in /Beer-v1/.

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