• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp:useBean standard action

 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The Generated Servlet code is


In above code, foo.person is an abstract class.
In above code example, cant we omit the type declaration of "foo.person" in jsp:useBean standard action and directly assign the foo.employee instance to p?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the sun docs:
# class="package.class"

Instantiates a Bean from a class, using the new keyword and the class constructor. The class must not be abstract and must have a public, no-argument constructor. The package and class name are case sensitive.
# type="package.class"

If the Bean already exists in the scope, gives the Bean a data type other than the class from which it was instantiated. If you use type without class or beanName, no Bean is instantiated. The package and class name are case sensitive.
# class="package.class" type="package.class"

Instantiates a Bean from the class named in class and assigns the Bean the data type you specify in type. The value of type can be the same as class, a superclass of class, or an interface implemented by class.

The class you specify in class must not be abstract and must have a public, no-argument constructor. The package and class names you use with both class and type are case sensitive. [/uote]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!