jQuery in Action, 3rd edition
The moose likes JSP and the fly likes JSP  usebean type Vs class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP  usebean type Vs class " Watch "JSP  usebean type Vs class " New topic

JSP usebean type Vs class

Awais Bajwa
Ranch Hand

Joined: Jan 16, 2001
Posts: 191
Hi folks,
Can anybody explain the difference between the "type" and "class" attributes in <jsp:usebean> tag.

Stefan Evans

Joined: Jul 06, 2005
Posts: 1580
Its all explained here:

In short:
"type" specifies the type of the scriptlet variable created.
"class" specifies the class of the variable to be created if it is null.

a contrived example:
<jsp:useBean id="date" type="java.util.Object" class="java.util.Date"
Object date = new java.util.Date();
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63869

A slightly more up-to-date "syntax card": http://java.sun.com/products/jsp/syntax/2.0/syntaxref20.html
[ March 20, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: JSP usebean type Vs class
jQuery in Action, 3rd edition