Hello Friends,
I am getting the following exception when i try to export the data using display tag's built-in facility.
[2008-02-26 16:54:27,472] WARN http-7070-Processor22 (BaseNestableJspTagException.java:99 ) - Exception: [.LookupUtil] Error looking up property "mgrname" in object type "java.util.ArrayList". Cause: Unknown property 'mgrname'
java.lang.NoSuchMethodException: Unknown property 'mgrname'
at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1122)
at org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:408)
at org.displaytag.util.LookupUtil.getProperty(LookupUtil.java:271)
at org.displaytag.util.LookupUtil.getBeanProperty(LookupUtil.java:129)
at org.displaytag.model.Column.getValue(Column.java:124)
at org.displaytag.export.BaseExportView.doExport(BaseExportView.java:265)
at org.displaytag.tags.TableTag.writeExport(TableTag.java:1404)
at org.displaytag.tags.TableTag.doExport(TableTag.java:1356)
at org.displaytag.tags.TableTag.doEndTag(TableTag.java:1227)
at org.apache.jsp.WEB_002dINF.jsps.common.tableViewTag_jsp._jspx_meth_displayTag_table_0(tableViewTag_jsp.java:195)
at org.apache.jsp.WEB_002dINF.jsps.common.tableViewTag_jsp._jspService(tableViewTag_jsp.java:89)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
..........................
..........................
Now,it doesn't face any problem while displaying data in table form on the page but when i try to export it (csv,excel,xml) then it fires the above exception.This is bit surprising to me.
The dispalytag related tags are in a jsp. This jsp is included in a Spring tag handler class by pageContext.include("xyz.jsp"). This tag(defined by the Spring Tag Handler class) is being used in another jsp where the table is displayed. Paging works perfectly, but when I click on export, the exception occurs.
I am using the followings:
JDK1.5,Displaytag 1.1 and Spring 1.2.7
The Actual flow is something like this.
1)Controller forwards the request to jsp page.
2)This jsp page uses a custom tag.
3)Now,the control goes to custom tag handler class where i set the all the data into request,
pageContext.getRequest().setAttribute("tableViewTag_data", data);
4)Then i have included the page like
pageContext.include("/WEB-INF/jsps/common/xyz.jsp");
5)This xyz.jsp contains the following code.
<displayTag:table pagesize="10" requestURI="${cmd.metaClass}.htm" name="tableViewTag_data" class="displaytag" decorator="${tableViewTag_options['decorator']}" export="true">
<displayTag:setProperty name="paging.banner.placement" value="top"/>
<c:forEach var="property" varStatus="propertyStatus" items="${tableViewTag_columnProperties}">
<c:set var="propertyTitle"><fmt:message key="field.${cmd.metaClass}.${property}" /></c:set>
<displayTag:column property="${property}" title="${propertyTitle}" />
</c:forEach>
</displayTag:table>
Here, I am able to retrieve all the data.
5)So,in this way the page is getting rendered.
I have also included export filter into web.xml file.
Hope i have provided all the information.
I think i haven't made any silly mistake. -:)
Looking forward to hear from you.
Thanks
Vishal Pandya