O'Reilly logo

Java All-in-One For Dummies, 5th Edition by Doug Lowe

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

Chapter 4

Using JavaBeans

IN THIS CHAPTER

check Defining JavaBeans

check Creating your own JavaBean classes

check Using JavaBeans in JSP pages

check Creating a simple shopping cart with session scope

A JavaBean is a special type of Java class that you can use in several interesting ways to simplify program development. Some beans are designed to be visual components that you can use in a graphic user interface (GUI) editor to build user interfaces quickly. Other beans, known as Enterprise JavaBeans (EJB), are designed to run on special EJB servers and can run the data access and business logic for large web applications.

In this chapter, I look at a more modest type of JavaBean that’s designed to simplify the task of building JavaServer Pages (or JSP, which I cover in Book 7, Chapter 3). In a nutshell, you can use the simple JavaBeans to build JavaServer Pages without writing any Java code in the JSP itself. JavaBeans let you access Java classes by using special HTML-like tags in the JSP page.

To use JavaBeans, you must have Tomcat enabled. For more information about installing and configuring Tomcat, please ...

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