• 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
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

attribute scopes

 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
a question extracteed from j2eecertificate.com


Which of the following attribute scopes are thread-safe? [Check all correct answers]


The correct answer is:
1. Request attribute.
2. Response attribute.
3. Session attribute.
4. Context attribute.
5. None of the above.

Feedback:
Answers 1 and 2 are correct. The request attribute and response attribute are thread-safe because the servlet container creates a single HttpServletRequest and a single HttpServletResponse per request. Therefore both attributes are only available for that request and hence cannot be shared by other requests.


To my sense, answer 2 should not be considered as exact here.
It's true that HttpServletResponse object is thread-safe, but HttpServletResponse is not an attribute scope. Or the question asks for atribute scopes...
What do you think? It's difficult to cut it short, isn't it?
Regards,
Cyril.
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, cyril vidal... U r right.. Response attribute is not an attribute scope...
And also I'm wondering whether they wanna ask about the object? HttpServletRequest Object, HttpServletResponse Object, HttpSession Object and ServletContext Object...
What do u think?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic