• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

q on jsp:useBean

 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which of the following statements r true regarding jsp:useBean

the value of beanName can be specified as a request time attribute expr.
the beanName can refer to a class or a serialzed bean.
value of the type attribute can be the class of the bean or its superclass, not an interface.
the class & beanName attributes cannto b used together.
the type attribute can be used only with class or beanname attribute.

i feel 4 & 5 are correct. but wht does 2 mean?
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My answers are 1,2,4

Thanks
 
Kiran Joshi
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even I feel 4 & 5 are correct.

beanName is only used in case of serialized bean.
here the object is stored in the persistent storage with extension .ser.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Option 5 is incorrect as you can use type without class and beanName.

beanName can be used for class as well as serialized bean.

Thanks
 
Priya Jothi
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Correct options are 1,2 & 4.

In usebean decl type attribute can be used alone => option 5 is wrong

In usebean decl beanname can be either class name or serialized bean name(can refer to SCWCD study kit for more details on this) & it can accept req time expn value => option 1 & 2 are correct.

hth..

Regards,
Priya.
 
rakesh mittal
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is serialized bean as given in option 2
 
M Rama
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what exactly is beanName? can someone explain or give links to this.
[ October 25, 2005: Message edited by: M Rama ]
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There has been no mention about beanName attribute in HFSJ Book.

Have a look at this thread. It should be useful


http://www.coderanch.com/t/288293/JSP/java/beanName-Attribute-useBean-action
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic