This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

jsp:useBean

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Thanks a ton Chetan
 
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic