aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes J2EE Certificate qs on useBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "J2EE Certificate qs on useBean" Watch "J2EE Certificate qs on useBean" New topic
Author

J2EE Certificate qs on useBean

shiva viswanathan
Ranch Hand

Joined: Aug 12, 2004
Posts: 152
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

Joined: Sep 30, 2002
Posts: 53
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.


SCJP 1.4<br />SCWCD 1.4
shiva viswanathan
Ranch Hand

Joined: Aug 12, 2004
Posts: 152
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

Joined: Sep 30, 2002
Posts: 53
Hi Shiva.
Yeah. Thats what I mean.

I hope it helped.
[ July 23, 2005: Message edited by: Osama Hasan ]
shiva viswanathan
Ranch Hand

Joined: Aug 12, 2004
Posts: 152
Thanks a lot Osama
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: J2EE Certificate qs on useBean