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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.