• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Quiz question

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
67
Marks: 0/1 Consider you have an otherwise correctly formulated classic tag handler with the code

public int doStartTag(){
//your code here
}
Which of the following can be used on the line after the comment to get an attribute from the session scope?

Choose at least one answer.
a. session.getAttribute("attributeName");
b. getSessionContext.getAttribute("attributeName");
c. bodyContext.getAttribute("attributeName");
d. pageContext.getAttribute("attributeName",PageContext.APPLICATION_SCOPE);

The website shows d. as the answer. But the scope would not match. This would have been the correct answer if application scope was mentioned in the question.
Please clarify if I interprete it wrong !
 
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I can see that none of the answers are correct!!!

If in choice d, the APPLICATION_SCOPE was replaced by SESSION_SCOPE that would have been the way to go, but, none of the listed options are correct.

Best of luck ...
 
Swati Udas
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the support

I had ticked session.getAttribute(); assuming that session is first retrived through proper methods.

Also I find that this quiz suggests that WEB-INF is must in every web-app
While notes by jothi shankar state something diferene. What do we consider correct for exam?

Wish me luck..appearing exam this saturday..2 days to go..
 
arch rival
Posts: 2813
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What web site did this question come from?
 
Swati Udas
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here -->

http://www.examulator.com/moodle/course/view.php?id=5

Summary Quiz 3.

One of the last 5-6 questions.
 
Nothing? Or something? Like this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic