Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

foreach  RSS feed

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37180
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
Marshal
Posts: 37180
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!