Deconstructing <jsp:useBean> and <jsp:getProperty>

All we really wanted was the functionality of <jsp:getProperty> because we wanted only to display the value of the person’s “name” property. But how does the Container know what “person” means? If we had only the <jsp:getProperty> tag in the JSP, it’s almost like using an undeclared variable—the name “person”. The Container usually has no idea what you’re talking about, unless you FIRST put a <jsp:useBean> into the page. The <jsp:useBean> is a way of declaring and initializing the actual bean object you’re using in <jsp:getProperty>.

Declare and initialize a bean attribute with <jsp:useBean>

image with no caption

Get a bean attribute’s property value with <jsp:getProperty>

image with no caption
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset