Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem about EL ....

 
Jack Lam
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

i have a problem in studying El...

when i create a Map in <% %> area:
<%
SortedMap map = new SortedMap;
map.put("key", "value");
%>
and want to display the data by using EL
${map.key}

but it show me nothing....
what is the reason?
it can show me ${header["user-agent"]}
that mean the page can run El at my tomcat..

also, do EL only for display the date?
(for replace the <%= XX %> tag)
how do i create instance by using EL?

i always get confuse with the format ${aaa.bbb.ccc}

thanks
 
Nitish Bahadur
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The map created in the scriptlet was never stored in one of the JSP scopes.

<%
Map map = new HashMap();
map.put("key", "value");
pageContext.setAttribute("map", map);
%>

<c ut value='${map["key"]}'/>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic