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

How it runs...

The first time you request the Hello.jsp, the JSP does the conditional test, discovers there’s no value for userName, and forwards to the HandleIt.jsp. Assuming the user types a name into the name input field, the second request won’t do the forward, since the userName request parameter has a non-null value.

First request for Hello.jsp

image with no caption

Second request for Hello.jsp

image with no caption
image with no caption

How come the “Welcome to our page!” text didn’t print out the first time?

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