JSP Custom Tag and forEach variable

R

Robert Jones

Ok Folks, I've got a problem using the iteration variable from a forEach
tag in a custom tag I wrote. The custom tag is supposed to use the
iteration variable as an index into an array. When I try to access the
JSP page I get the following exception:

org.apache.jasper.JasperException: For input string: "${current}"

Along with this Root Cause:

java.lang.NumberFormatException: For input string: "${current}"

Now, I've defined my custom tag to take index as a String, Integer or
int. I've basically overloaded the setIndex function.

<c:forEach begin="0" end="5" step="1" var="current">
<tr>
<td><salsys:location index="${current}" type="location" /></td>
<td><salsys:location index="${current}" type="calloutNumber" /></td>
</tr>
</c:forEach>

So anyway, I've just come across something that says I can't use the EL
evaluator with Custom Actions. Fine. Then my problem is as follows:

I need to examine a list of files, whose names have the same canonical
form, i.e. x.location. This list is variable from one invocation to the
next. I then want to display some information about each file.

I've written a bean that can get a list of x.location files and stores
the properties I need access to (I've written the appropriate getter
methods). I also wrote a corresponding custom tag to get access to the
bean.

So, how can I handle the variable list of files? Do I have to do
everything in the custom tag? This seems kind of clunky as it will
require me to tie the view to the controller. What am I missing?

I'm not really sure where this questions falls, so I cross-posted.

Thanks,
Robert Jones
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top