• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock exam question SCWCD

 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
question :

A JSP page needs to instantiate a JavaBean to be used by only that page.
Which 2 jsp:useBean attributes must be used to access this attribute in the JSP page?

A.id
B.type
C.name
D.scope
E.create
F.class

id is the MUST attributes inside a jsp:useBean right? so what is the other one that is a MUST attributes?

or id is not one of the answers?

pls explain to me...

i know its simple. i just wanna make sure...
 
Nishant Dhar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for instantiating a new bean, i think the id is a must.
the second would be 'class' according to me, since 'class' attribute specifices which java class is to be used for instantiation.

nishant
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i believe, minimum 2, in that case, is id(so you can use it later in the jsp), and class
 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oic. thanks guys...anymore?
 
Will Lee
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A.id & F.class

The reason I don't choose other choices is:
B.type: only when bean exists in the scope can one use this and omit "class"
C.name: it should be in <jsp:g/setProperty>
D.scope: since you wanna create it in default scope, that is page, i guess no need to include it
E.create: I never saw it in <jsp:useBean>

Don't know if I'm right or not?
 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.....

"create" is not exist in <jsp:useBean>

i like your explanation. thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic