Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Quiz question

 
Swati Udas
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • 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 !
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • 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
  • 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..
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic