Raging Goblin

2 May 2013

Spring Roo 7: JSTL

Filed under: Java,Spring Roo — Raging Goblin @ 08:02
Tags: , ,

Yesterday I tried to edit a Spring Roo generated view and used one of those handy constructs of the jstl (JavaServer Pages Standard Tag Library), the foreach loop:

<c:forEach items="${vmpadresses}" var="address">
   <input type="text" value="${address}" />
</c:forEach>

When I ran the page it threw a org.apache.jasper.JasperException to me with the message: The prefix “c” for element “c:forEach” is not bound. I thought what, no jstl?! But of course I was wrong, it is just not registered in the generated views. Look for the tag with all the other tag directives. In my case this was the div tag. Ad

xmlns:c="http://java.sun.com/jsp/jstl/core"

to this tag so that it reads something like this:

<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:page="urn:jsptagdir:/WEB-INF/tags/form" version="2.0">

The dependency for the jstl is already in the pom, so this is all you have to do and all is fine again.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: