• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

For JSTL + EL experts

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the example:


I have an object that has a map ( myMap ), where myMap holds another map(acessed a entry with "key2"). I can get the value using common EL outside JSTL tags, but when I try to use <c:if test="...it fails saying:





What could this be? When I use<c:if test="${!empty myobject.myMap}"> it works....damN!
[ June 16, 2008: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's in column 63 of the failing line?
 
Dan Nun
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know. When I compile in the IDE I can't see the source code generated by the JSP. There's no way for me to know this, sorry...

But....I've manage to make it work. I switched all the (") characters in the <c:if tag using map objects to (') characters. Now it's all working. I didn't even know that we could use this character =)

But thank's anyway...
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

test="${!empty myobject.myMap["key1"]}"



If you use the quote character to delimit the attribute, then yeah, you need to use ' inside or the parser thinks that your quote is being closed.
 
You have to be odd to be #1 - Seuss. An odd little ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic