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 the <jsp:useBean> tag and its associated helper tags is that you should try to move as much of your application logic as possible out of your JSP so all that remains is code to display the output.
When you encapsulate business objects or business logic into a Java class, you should make that Java class a bean. Many of Sun's Java APIs and tools revolve around the idea that you put your logic into beans and then use tools to help you create applications that use those beans. JSP is one of those tools.
Adding the Bean to the Page
When you add a bean to a JSP, ...
Get Special Edition Using Java™ 2 Enterprise Edition 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.