This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:UseBean related

 
Simran Dass
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

For the beanName attribute the Jsp spec says :

If we use The attribute beanName specifies the name of a Bean, as specified in the
JavaBeans specification. It is used as an argument to the instantiate method in the
java.beans.Beans class. It must be of the form a.b.c, which may be either a class,
or the name of a resource of the form a/b/c.ser that will be resolved in the current ClassLoader. If this is not true, a request-time exception, as indicated in the
semantics of the instantiate method will be raised. The value of this attribute can
be a request-time attribute expression.


What does "or the name of a resource of the form a/b/c.ser that will be resolved in the current ClassLoader." MEAN ?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2534
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Simran,

What does "or the name of a resource of the form a/b/c.ser that will be resolved in the current ClassLoader." MEAN ?

When using the beanName attribute
beanName="{package.class | <%= expression %>}" type="package.class"

the bean can be instantiated from a class definition, or if the bean is in a serialized form it can be deserialized and instantiated from a .ser file (if you use serialize a .java file, you will get a .ser file)

To read more about serialization (Sun article)

Regards,
Frits
 
Simran Dass
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks .

So in the foll question (Whizlabs) --

State true/false

a) The beanName attribute can refer to a class or a serialized bean.

b) The type attribute can be used with only class or beanName attribute.


a is true and b is false - is it correct.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2534
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a is true and b is false - is it correct.

Yes, correct.

Proof is found here Sun jsp:UseBean

Regards,
Frits
 
Simran Dass
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic