• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

c:set target

 
swarna dasa
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic