Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Websphere 6 not recognizing c:forEach

 
Mike Ottinger
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have a simple jsp with the following:



In tomcat, this displays my list data fine. In websphere 6, its a different story. Looking at the source of the generated html, I see this:



It isn't evaluating the tag at all, and its taking the list held in 'data' and printing it out within the items attribute. I can't say that I've seen this before, usually jstl tags either work or don't work in my experience. Just doing simple ${my_var} seems to work but not with forEach. This is the taglib declaration I'm using:



I've also tried it with the uri set as http://java.sun.com/jsp/jstl/core and I've tried the core_rt version as well, all the same result. Tomcat is fine with is, WebSphere 6 is not. Any help on this is greatly appreciated. Thanks.
[ June 16, 2006: Message edited by: Marilyn de Queiroz ]
 
Mike Ottinger
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, using the code blocks messed things up, this is what my jsp file looks like:


<c:forEach var="d" items="${data}">
${d}

</c:forEach>

and the view source on it looks like this:

<c:forEach var="d" items="[I live in the database!, So do I!]">


</c:forEach>

thanks!
 
Mike Ottinger
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, third time:

Basically when I use the below syntax in websphere:

c:forEach var="${d}" items="${data}"

I actually get this in the html:
c:forEach var="d" items="[I live in the database!, So do I!]"

it's not evaluating forEach it's just replacing my ${}'s
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike Ottinger:
Well, using the code blocks messed things up, this is what my jsp file looks like:


<c:forEach var="d" items="${data}">
${d}</br>
</c:forEach>

and the view source on it looks like this:

<c:forEach var="d" items="[I live in the database!, So do I!]">
</br>
</c:forEach>

thanks!

You probably figured out by now that it's not the code tags messing things up, it is the angle braces. If you substitute &lt; for <, you'll get better results in this particular (IBM/Websphere) forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic