• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between getRequest().getSession()  RSS feed

 
Philip Zac
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone,


What is the Difference between getRequest().getSession().getAttribute(asd) and getSession().getAttribute(asd) ???

Thanks in advance....

Philip
[ June 24, 2008: Message edited by: Bear Bibeault ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This doesn't appear to be an ORM question. It looks liek a Servlets question for I'll move it over there.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Philip Zac , please dont post same question multiple times.
And I am not sure if the above methods you are using are valid, if they are, then the functionality you get should be same.

What did you get?
 
Philip Zac
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello Amit,

The result of the both methods is same. but the only difference is the coding part which is written above.

I thought some brilliant mind would explain to me..

Thanks anyway,
Philip
 
cortin flaneir
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getSession(java .lang.String)and getSession(Boolean b) method is return the current session if its set in request and if there is no session the its returns new session.The getAttribute() methods return the object associate with this session. this is the concept.And now what you want to ask clearfy?with description.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

getSession().getAttribute(asd)

I was unsure about the validity of the above code, which object are you using to invoke the above method.
Because you'll need the request object itself, so its similar to the other one.



Hope this helps
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!