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

But wait ! It gets even better...

And all you have to do is make sure your form input field name (which becomes the request parameter name) is the same as the property name in your bean. Then in the <jsp:setProperty> tag, you don’t have to specify the param attribute. If you name the property but don’t specify a value or param, you’re telling the Container to get the value from a request parameter with a matching name.

If we change the HTML so that the input field name matches the property name:

image with no caption

We get to do THIS

image with no caption

Note

If the request parameter name matches the bean property name, you don’t need to specify a value in the <jsp:setProperty> tag for that property.

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