File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "c:set target" Watch "c:set target" New topic

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é

Joined: Nov 24, 2005
Posts: 14688

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

Thanks again.
I agree. Here's the link:
subject: c:set target
It's not a secret anymore!