• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

type attribute of jsp:useBean action

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
what is the type attribute for that action?
what i understood it is specifies the type of the object.
what is the difference between the type and class attribute?
thanks alot
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The difference between a class and an interface. Or a superclass.
In

if you say in the JSP that the "type" is ActionListener you can only use the methods defined in that interface.
If you don't say "type" and just class, then you can use all the methods of the class, in the object.
Also, the same applies to class/superclass relationships. You may have a subclass X but use "type" of its superclass.
I have never needed to use the "type"...
Anyone?
[This message has been edited by Tony Alicea (edited March 05, 2001).]
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The type attribute allows you to do a class cast on a class or beanName. Only upcasts (casts to a superclass or an interface implemented by class) are allowed.
The type attribute can be used by itself (i.e., without beanName or class) if the id attribute specifies a bean that is already instantiated. Otherwise, the type attribute must be used to do a class cast on a beanName or class specified in the same tag.
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic