File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SessionAttributes Doubt?

 
Joe Harry
Ranch Hand
Posts: 10047
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

The statement, "Attributes bound into a session are available to any other servlet that belongs to the same ServletContext" Will this be true or false?? if true why?
 
Joe Harry
Ranch Hand
Posts: 10047
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any help guys?? I got this statement from HFSJ book!
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

"Attributes bound into a session are available to any other servlet that belongs to the same ServletContext"


There is one ServletContext object per web application per JVM. If all session objects belong to one web application as are, attributes bound to
session will be available to any servlet that belong to that particular
web-app.

It is what I could thought to be.


Thanks,
 
Amol Nayak
Ranch Hand
Posts: 218
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the webapp is distributed the same Session object is used, but the ServletContext is one per jvm..

So

"Attributes bound into a session are available to any other servlet that belongs to the same ServletContext"

Is not true.. It can also be accessed from different ServletContext of the same distributed webapp.


Amol...
 
jayaram parisineni
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Session attributes are not accessible by all servlets in a web - application, they are accessible by any servlet or Jsp which access that particular session.So the answer is false and reason is what i explained.


Thanks,

Jayaram
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic