Chapter 9. Interacting with JavaBeans

In this chapter

The <%, <%=, and <%! tags provide you with a way to access Java beans. Pages that use these tags, however, tend to look cluttered. You would be better off accessing Java bean properties in a Java Server Page using standard tags. That way, your page looks like a normal HTML page with a few extra tags. The <jsp:useBean> tag gives you the ability to create Java beans, and the <jsp:getProperty> and <jsp:setProperty> tags allow you to manipulate bean properties.

The <jsp:useBean> Tag

When you want to use a Java bean within a Java Server Page, use the <jsp:useBean> tag to either create a new instance of the bean or use an existing bean. The idea behind ...

Get Special Edition Using Java™ Server Pages and Servlets 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.