wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes c:set target Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "c:set target" Watch "c:set target" New topic
Author

c:set target

swarna dasa
Ranch Hand

Joined: Mar 15, 2007
Posts: 108
I am trying to use c:set with a map and i get the following error



The error is caused due to the following lines in the jsp (line 1 and line 2)




Seems like i am missing some very basic concept in JSTL.
Any help would be appreciated.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

1. You've declared a Map in a scriptlet, which will not be accessible from EL, unless you put it in a scope.
Try to add request.setAttribute("map", map);
2. I don't think you can add values to the request map.


[My Blog]
All roads lead to JavaRanch
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
If i am not mistaken the target attribute in the c:set should evaluate to the exact object.. not getting ${requestScope} in the second statement..
swarna dasa
Ranch Hand

Joined: Mar 15, 2007
Posts: 108
Thanks for your input.
Guess one can't add values to a requestScope map, so that fails.

Added the map to the page scope in the scriplet and now it works fine
pageContext.setAttribute("map",map);

Thanks again.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: c:set target