• Post Reply Bookmark Topic Watch Topic
  • New Topic

EL related problem-Explanation needed

 
Priyanka Mathur
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this is the servlet code

java.util.Map musicMap = new java.util.HashMap();
musicMap.put(�Ambient�, �Zero 7�);
musicMap.put(�Surf�, �Tahiti 80�);
musicMap.put(�DJ�, �BT�);
musicMap.put(�Indie�, �Frou Frou�);
request.setAttribute(�musicMap�, musicMap);
request.setAttribute(�Genre�, �Ambient�);

Then why this work
Music is ${musicMap[Genre]}

and this do not works

Music is ${musicMap[�Genre�]}
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose

request.setAttribute("key","value");

how you will see the value of key in EL?

using ${key} right? not like ${"key"}

you got it?

Hope This Helps
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!