• 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

Session usage in JSP

 
Ranch Hand
Posts: 180
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,


Just a general question in JSP.If my app is used by loads of users
concurrently.Does using the session for retrieving the objects causes any problem?.

Most of objects are in request scope but in some cases i have to use session scope.So in those cases in my java classes i am using in the session.But while retrieving in the JSP i am using the request scope by putting the object in the request before forwarding it to the JSP.

Please help
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Session scope should only be used for user-specific data that needs to stick around for more than one request. For simply passing data from a controller servlet to a JSP for display, the request is the correct scope to use.

When creating session data, especially in an environment where there are many users, it's important to be sure to release any data that is no longer being used to avoid unnecessary memory overhead. This leads some misinformed shops to disallow use of the session completely -- which is pretty silly. Just be sure to do a bit of housekeeping to make sure that session data doesn't hang around for longer than it needs to.
[ February 12, 2008: Message edited by: Bear Bibeault ]
reply
    Bookmark Topic Watch Topic
  • New Topic