Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Problem about EL ....

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"]}'/>
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic