• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not convinced by the answer for Chapter 5 Mock Exam question

 
Nivedita Thakur
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

This is a question on Chapter 5 Mock Exam question(No.7) of Head First Servlets Book. Here is the exam question.

"Which is most logically stored as an attribute in session scope?"

One of the options which I thought was correct, was shown wrong. Here is the option.

"A copy of a query parameter entered by a user."

Why is this not a correct option? There could be a case where I might want to store that parameter in the session for further use.

(I am new to this forum, so if I need to provide more info or post differently, let me know), thanks!
 
Himanshu Kansal
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

A query parameter would usually go in the request object.

Could you please give the other options!

Regards
 
Nivedita Thakur
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A. A copy of a query parameter entered by a user

B. The result of a database query to be returned immediately to user.

C. A database connection object used by all web components of the system.

D. An object representing a user who has just logged into the system.

E. A copy of an initialization parameter retrieved from a ServletContext object.


I conveniently overlooked the word "most" in the question and opted for two answers i.e. A and D. Apparently, D is most logical.
Thanks for the reply!
 
Himanshu Kansal
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome

That's a common mistake, looked like a CAT question
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic