GRAPHIC JAVAThe evolution of Java Server Pages

GRAPHIC JAVA
The evolution of Java Server Pages

David Geary

Listing 4. JSP and JavaBeans.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<jsp:useBean id="item" scope="request"
class="com.sunpress.beans.Item"
<jsp:setProperty name="item" property="description" value="total
jim" /
</jsp:useBean <%— Access item description with JSP expression —
%>

Here's the item's description from a JSP expression:

<%= item.getDescription() %>
<%— Access item description with JSP tag —%>

Here's the item's description from a tag:

<jsp:getProperty name="item" property="description" /

About the Author

David Geary was the lead engineer for the Java Management API GUI toolkit, and is now an independent Java consultant. David is the author of Graphic Java—Mastering the JFC. He can be contacted at sabreware@tri-lakesonline.net.

Featured

Upcoming Events

AppTrends

Sign up for our newsletter.

I agree to this site's Privacy Policy.