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

Question from Marcus green

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the following statements are true?
Choose at least one answer. a. Once an ServletRequest attribute has been set, it is visible to all subsequent requests
b. Data in a HttpSession attribute will not be available if the web server restarts
c. Data in the ServletContext can be shared by any servlet of the same web application.
d. The getParameter method of HttpSession will retrieve a session attribute

I answered both b and c but the correct one is only c. b is incorrect for following reason:Although session attribute data may dissapear if Tomcat is restarted, this is not guaranteed behaviour and some web servers may store session data in a database.

Which web server stores the session attribute even after restarted? And whats the point in retaining the session data once the session is invalidated?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Containers like Tomcat offers the possibility to persist/reload sessions when the server is shutdown/started. This is enabled by default.
 
arch rival
Posts: 2813
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The exam tests on the standard, not the reference implementation. In theory you could be running an implementation that does not persist sessions between resets of the server. I doubt however if this relatively arcane point is covered by the exam, so I wouldn't worry too much about it and perhaps I should change the question.
 
reply
    Bookmark Topic Watch Topic
  • New Topic