By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,468 Members | 1,859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,468 IT Pros & Developers. It's quick & easy.

jsp - different session.getAttributes

P: n/a
Hi!
I wonder if there is a difference [if so, what] between:

User user = (User)session.getAttribute("user");

and:
User user = (User)request.getSession(false).getValue("user");

/peter
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"asaguden" <as******@lycos.com> wrote in message
news:b1*************************@posting.google.co m...
Hi!
I wonder if there is a difference [if so, what] between:

User user = (User)session.getAttribute("user");

and:
User user = (User)request.getSession(false).getValue("user");

/peter


request.getSession(false) and session refer to the same object, as does
request.getSession(true). The difference is that the latter will create a
session object if one does not exist. The difference between getAttribute
and getValue is that getValue is deprecated. Use getAttribute.
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.