The tags will display an empty image
only if the value is a null. Indexing is very much of a java language n hence
the jsp gives out an exception during the runtime if the index is
erraneous.
Hope i'd understood the problem
clearly....
----- Original Message -----
Sent: Thursday, June 15, 2006 12:35
AM
Subject: [displaytag-user] JspException
trying to reference empty List via 0index
Hi everyone,
First off, I am using displaytag 1.1. I am getting the following exception when I try to access an empty index inside a list for my column display
javax.servlet.jsp.JspException: Index: 0, Size: 0 at org.displaytag.render.TableWriterTemplate.writeTable(TableWriterTemplate.java:161) at org.displaytag.render.HtmlTableWriter.writeTable(HtmlTableWriter.java:643) at org.displaytag.tags.TableTag.writeHTMLData(TableTag.java:1549) at org.displaytag.tags.TableTag.doEndTag(TableTag.java:1218)
My bean has an infos list (when empty causes the above exception)
--- Here is my a sniplet of my JSP using the display tag --- <display:table name="results" id="row" > <display:column property="name" escapeXml="true" title="name" /> ... <display:column property="infos[0].property1" escapeXml="true" title="property 1"/> <display:column property="infos[0].subProperty2" escapeXml="true"
title="property 2"/> ... </display:table> --- I am able to get around it with the following modified JSP, but I think the tag should display empty strings in this scenario instead of throwing a JspException --- ... <display:column escapeXml="true" title="property 1"> <c:if test='${row.info[0] != null}'> <c:out value="${row.info[0].property1}"/> </c:if> </display:column><display:column escapeXml="true" title="property 2"> <c:if test='${row.info[0] != null}'> <c:out value="${row.info[0].property2}"/> </c:if> </display:column>
...
Is this a bug in the display:column tag lib or maybe JSTL or am I missing something?
Regards,
Neon
__________________________________________________ Do You
Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________ displaytag-user
mailing
list displaytag-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/displaytag-user
Internal Virus Database is out-of-date. Checked by AVG Free
Edition. Version: 7.1.394 / Virus Database: 268.8.0/352 - Release Date:
5/30/2006
|
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user