O'Reilly logo

MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL by James Turner

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

Wrapping Up Beans

It wouldn't be an overstatement to say that Java Beans are the key to making JSP work. They're the difference between a simple scripting language that lets you put programmatic content on a Web page and a programming environment that lets you leverage all the power of object-oriented design for your application.

Java Beans contain state, which is accessed using get and set methods on the Bean. They also have scope in JSP—either page, request, session, or application. Different scopes allow the bean to persist for different amounts of time. jsp:useBean is used to associate a Bean with a name and a scope on a JSP page. jsp:setProperty is used to apply form values to a Bean. Singleton classes can be used to avoid creating multiple ...

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