aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Scriplet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Scriplet" Watch "Scriplet" New topic
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
    
  13

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
    
  13

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
    
  13

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
    
  13

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...>
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Scriplet
 
Similar Threads
HashMap remove multiple elements
how to send multiple data in a table in a mail application?
[solved]bean mySearchBean not found within scope
<c:set Usage
Iterator in Struts 1