• 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

foreach

 
author & internet detective
Posts: 41086
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm writing my first page using JSTL core tags and am running into trouble. I have used EL a bit and custom/Struts tags extensively.



This code outputs:

Subject test
found one: ${post.subject}



The scriptlet shows that the value is in fact set in the servlet to have a subject. The c:forEach does recognize that there is one element in the loop. I can't figure out how to get it to output a field via a getter though. This seems like I'm missing something obvious.
 
Sheriff
Posts: 67637
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
Looks like the EL is not getting evaluated. Do you have the web app set up properly using the Servlets 2.4 XML Schema in the deployment descriptor? (And using Tomcat 5 or 6?)
 
Jeanne Boyarsky
author & internet detective
Posts: 41086
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Looks like the EL is not getting evaluated. Do you have the web app set up properly using the Servlets 2.4 XML Schema in the deployment descriptor? (And using Tomcat 5 or 6?)


Oh! It's using servlets 2.3. Which means I needed to add a line to the top of the JSP:


Thanks Bear!
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic