• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

J2EE Certificate qs on useBean

 
shiva viswanathan
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The question :

Which of the following are correct JSP useBean declarations? [Check all correct answers]



1. <jsp:useBean id="softDrink" beanName="Drink.ser" type="com.baboon.interface.Drink" />
2. <jsp:useBean id="softDrink" beanName="Drink.ser" class="com.baboon.interface.Drink" />
3. <jsp:useBean id="card" class="com.baboon.cardgame.Card" />
4. <jsp:useBean beanName="instructor" class="com.baboon.users.Instructor" />
5. <jsp:useBean id="iDevice" type="com.baboon.types.Device" />

Answers given 1,3,5

My doubt : how is 1 correct is there an attribute called as beanName
for the jsp:useBean custom action

Request some one to clarify

Thanks
Shiva
 
Osama Hasan
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is certainly an attribute named 'beanName' in the useBean tag. The beanName attribute can refer to a class name or the name of a serialized file containing the bean. The beanName and class attributes cannot be used together. That is why option 2 and 4 are incorrect.
 
shiva viswanathan
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Osama

So are you saying that we can either use beanName or class , it means the
same but in addition beanName can also refer to a serialized bean file name ?

Thanks
Shiva
 
Osama Hasan
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shiva.
Yeah. Thats what I mean.

I hope it helped.
[ July 23, 2005: Message edited by: Osama Hasan ]
 
shiva viswanathan
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Osama
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic