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

Get Head First Servlets and JSP, 2nd Edition 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.