• 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

JSTL & EL, not resolving my ${identifier} syntax?

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


The NavigationMenu bean is just a subclass of LinkedHashSet, using the generic <NavigationItem>. NavigationItem itself is a bean with properties "text", "url" and "active".

When NavigationMenu has 5 items in it my loop only runs for one iteration and the ${item.text} and ${item.url} strings are just output directly without being resolved.

I know I must be doing something wrong but I'm not sure what

The taglib uri I'm specifying is http://java.sun.com/jsp/jstl/core (indicated in the Jakarta taglibs README file).

I can post the source for NavigationMenu and NavigationItem if needed although I doubt that's where the problem lies.

[ September 08, 2007: Message edited by: Chris Corbyn ]
[ September 08, 2007: Message edited by: Chris Corbyn ]
 
Sheriff
Posts: 67747
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
Look at the View Source from the browser. Are the JSTL tags getting evaluated? From your symptoms, I'd think perhaps not.
 
Chris Corbyn
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help

The tags are being evaluated in the source yes. They disappear. If I do:



I just get ${i} literally output 5 times. I've tried using /jstl/core_rt instead of /jsp/jstl/core but it makes no difference.

All I did to install JSTL on my tomcat6 contain was download Jakarta's JSTL package (1.1.2) and copy lib/standard.jar and lib/jstl.jar into the libs directory with everything else. I got the impression this was all I needed to do, but I suspect I've missed something.
 
Chris Corbyn
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
*sobs*. Well I just installed the examples which Jakarta provide "standard-examples.war" and low and behold they work.

Here's my actual page (added more JSTL since last post, knowing that it 'will' work when I fix this problem :P)

 
Bear Bibeault
Sheriff
Posts: 67747
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

Originally posted by Chris Corbyn:
I just get ${i} literally output 5 times.

Sounds like the EL is not enabled for your app. Did you declare the app properly using the Servlets 2.4 schema as outlined in the JSP FAQ? Or are you using the 2.3 DTD?

I've tried using /jstl/core_rt

That's a JSTL 1.0 library. Forget it exists.

All I did to install JSTL on my tomcat6 contain was download Jakarta's JSTL package

Your issue is not with the JSTL.
 
Chris Corbyn
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Did you declare the app properly using the Servlets 2.4 schema as outlined in the JSP FAQ? Or are you using the 2.3 DTD?



Bingo! Now I feel stupid

EDIT | BBCode syntax wasn't compatible
[ September 08, 2007: Message edited by: Chris Corbyn ]
 
Chris Corbyn
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I'm losing my marbles The EL is now being interpreted correctly after chaning to the 2.4 web-app declaration, but now my custom tags are causing errors.



/WEB-INF/jsp/layout/layout.jsp(31,22) According to TLD or attribute directive in tag file, attribute to does not accept any expressions




[ September 08, 2007: Message edited by: Chris Corbyn ]
 
Chris Corbyn
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, somebody shoot me between the eyes then delete this thread

rtexprvalue. I never quite broke that string down into RT Expr Value before now

Solved
[ September 08, 2007: Message edited by: Chris Corbyn ]
 
They worship nothing. They say it's because nothing lasts forever. Like this tiny 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