• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp:useBean

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is this valid???

<jsp:useBean id="softDrink" beanName="Drink.ser" type="com.baboon.interface.Drink" />

have never seen something like this before.
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by geetu lalchandani:
is this valid???

<jsp:useBean id="softDrink" beanName="Drink.ser" type="com.baboon.interface.Drink" />

have never seen something like this before.




Ya it is perfectly valid. You might be confused by beanName="Drink.ser" - it indicates that look Drink.ser file and desterilize object from it.


**************
beanName="{package.class | <%= expression %>}" type="package.class"

Instantiates a bean from a class, a serialized template, or an expression that evaluates to a class or serialized template. When you use beanName, the bean is instantiated by the java.beans.Beans.instantiate method. The Beans.instantiate method checks whether the package and class you specify represents a class or a serialized template. If they represent a serialized template, Beans.instantiate reads the serialized form (which has a name like package.class.ser) using a class loader.

source
**************
[ September 14, 2006: Message edited by: Chetan Parekh ]
 
geeta lalchandani
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so,
the beanName is similar to the 'class' is it? In that case, why an additional attribute... class and beanName???
 
geeta lalchandani
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sorry..

i did read this.. but need a little more information on this..

Ya it is perfectly valid. You might be confused by [i]beanName="Drink.ser"/i] - it indicates that look Drink.ser file and desterilize object from it.



Yes, was confused by the beanName. So what beanName provides is to serialize/de-serailize the file referred to in here and create a object of the type specified by 'type'.

Is that correct?
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<jsp:useBean id="softDrink" beanName="Drink.ser" type="com.baboon.interface.Drink">
Means....

com.baboon.interface.Drink softDrink = new ObjectCreatedFrom-Drink.ser-File.

<jsp:useBean id="softDrink" beanName="Drink" type="com.baboon.interface.Drink">
Means....

com.baboon.interface.Drink softDrink = new Drink();
[ September 14, 2006: Message edited by: Chetan Parekh ]
 
geeta lalchandani
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a ton Chetan
 
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic