This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

jsp:useBean

 
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JSP page has the following useBean declaration that references a bean called Person. The person class has a private field called firstname and an appropriate getter (accessor) method for retrieving the value of that field.

<jsp:useBean id="person" type="com.examulator.Person" class="com.examulator.Person" scope="session" />

Which of the following is the correct syntax for a getProperty tag to retrieve the value of the instance of Person.

a)
<jsp:getProperty name="person" property="firstname"/>

b)
<jsp:getProperty name="person" property="getFirstname"/>

c)
<jsp:getProperty id="person" property="firstname"/>

d)
<jsp:getProperty name="person" property="firstname" class="com.examulator.Person"/>

e)
<jsp:getProperty name="person" property="firstname" scope="session"/>

Choose one answer.
a. a -answer
b. b
c. c
d. d
e. e

-This example is from Marcus Green's mock exam. I answered "e" but they say it's "a". Why is it so? Can somebody please explain?
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the jsp specs. Only name and property are the jsp:getProperty attributes.
 
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
scope attribute is only for jsp:useBean tag.
 
Oh the stink of it! Smell my tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic