| Author |
can request and session attribute share the same name
|
Kalyana Sundaram
Ranch Hand
Joined: Mar 18, 2005
Posts: 94
|
|
Can request and session attribute share the same name. In that case will there be any loss of attributes. My question is, will I be able retrieve both the attributes in session and request that have same name... Thanks in Advance
|
Only those who will risk going too far can possibly find out how far one can go !!!
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56179
|
|
"kalyan", We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it. In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Thanks! bear Forum Bartender
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56179
|
|
With regards to your question, the answer is yes. Though be aware that in certain circumstances, the request-scoped variable will hide the session-scoped variable (e.g. in unqualified EL references to the scoped variable, or when using PageContext.findAttribute())
|
 |
Kalyana Sundaram
Ranch Hand
Joined: Mar 18, 2005
Posts: 94
|
|
Assume that the attribute "name" is in bith session and request scope.... if i use someting like <c ut value=${'name'}/> So the request scope variable would hide the session scoped variable. If i were to get the session scope variable , i will have to use <c ut value=${'name'}scope="session"/> Is this right ???
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56179
|
|
Not quite. To retrieve the session-scoped variable you would use: P.S. When posting code, be sure to click the 'disable smilies' checkbox near the bottom of the page. That way your <c ut> tags will look less surprised.
|
 |
 |
|
|
subject: can request and session attribute share the same name
|
|
|