• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

mock exam question SCWCD

 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oic. thanks guys...anymore?
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes.....

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

i like your explanation. thank you.
 
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic