| Author |
Scriplet
|
amarkirt saroay
Ranch Hand
Joined: Mar 16, 2008
Posts: 167
|
|
In which scope does the variable declared inside the scriplet get created? page scope? can i access it inside any EL expression directly there after?
But this did not work for a map:
<% Map<String,String> mymap=new HashMap<String,String>();
mymap.put("5","val1");
%>
<c: out value='${mymap["5"]}' />
This did not show up anything
|
SCJP-75%
SCWCD-82%
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56210
|
|
|
None.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56210
|
|
|
Also, Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.
|
 |
Himanshu Kansal
Ranch Hand
Joined: Jul 05, 2009
Posts: 257
|
|
Well, how would access the value in the map in a pojo?
Definitely not mymap["5"]... think more
The scope is synonymous to page scope.
|
Experience and talent are independent of age
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56210
|
|
Himanshu Kansal wrote:The scope is synonymous to page scope.
It is not. Scriptlet variables are not part of any EL scope. None. Nada. Zero.
|
 |
Himanshu Kansal
Ranch Hand
Joined: Jul 05, 2009
Posts: 257
|
|
|
Reading my statement again for better understanding might help.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56210
|
|
|
Your statement says to me that you are claiming that creating scriptlet variables is synonymous with creating them in page scope. Which is, of course, not correct. If you meant something else, you will need to elaborate.
|
 |
Himanshu Kansal
Ranch Hand
Joined: Jul 05, 2009
Posts: 257
|
|
what is the scope of the variable created by:
<c:set...>
|
 |
 |
|
|
subject: Scriplet
|
|
|