Hmmm thanks for a fast reply.

How is that suppose to work?

I have made a little example but I cannot get it to work.
In jsp-file
<%
    Map<String, String> map = new HashMap<String, String>();
    for (int i = 0; i < 10; i++) {
        map.put("a", "a" + String.valueOf(i));
        map.put("b", "a" + String.valueOf(i));
        map.put("c", "a" + String.valueOf(i));
    }
    request.setAttribute("map", map);
%>
        <display:table name="map" export="true" pagesize="10000" 
defaultorder="descending">
            <display:setProperty name="export.excel.filename" value="test.xls"/>
            <display:column property="map(a)" title="A*"/>
            <display:column property="map(b)" title="B*"/>
            <display:column property="map(c)" title="C*"/>

        </display:table>


javax.servlet.jsp.JspException: Error looking up property "map(a)" in object 
type "java.lang.String". 
org.displaytag.render.TableWriterTemplate.writeTable(TableWriterTemplate.java:161)
org.displaytag.render.HtmlTableWriter.writeTable(HtmlTableWriter.java:643)
org.displaytag.tags.TableTag.writeHTMLData(TableTag.java:1549)
org.displaytag.tags.TableTag.doEndTag(TableTag.java:1218)
org.apache.jsp.viewDamageStatistic_jsp._jspService(viewDamageStatistic_jsp.java:394)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:358)
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
org.mortbay.http.HttpContext.handle(HttpContext.java:1807)
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)
org.mortbay.http.HttpContext.handle(HttpContext.java:1757)
org.mortbay.http.HttpServer.service(HttpServer.java:879)
org.mortbay.http.HttpConnection.service(HttpConnection.java:789)
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:960)
org.mortbay.http.HttpConnection.handle(HttpConnection.java:806)
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:218)
org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:331)
org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:520)





Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Ed Webb
Skickat: den 20 februari 2008 10:32
Till: displaytag-user@lists.sourceforge.net
Ämne: Re: [displaytag-user] [displaytag - Help] RE: Creating display tables 
from 2D string ar

Simon Rydberg wrote:
> I asked this question in late January but recived no response.. Is that 
> possible to do?
>
> Posted my original question at the end of this message..
>
> /Simon
>
>
> Hi!
>
> I want to display columns that does not exist as properties in a class. 
> Instead I have stored the data in a map.
> [snip]
>   

I saw your question when it was originally posted but couldn't get my 
head round what you were trying to do and hoped someone else would.

Have you tried something like this?

<display:table name="datas">
    <display:column property="key" title="Key"/>
    <display:column property="map(b1)" title="B1"/>
    <display:column property="map(b2)" title="B2"/>
    <display:column property="map(b3)" title="B3"/>
    <display:column property="map(b4)" title="B4"/>
</display:table>


The documentation shows this way of specifying mapped properties here 
<http://displaytag.sourceforge.net/11/tut_sources.html> and although 
this is for the name attribute of the <display:table> tag it may also 
work for the property attribute.

Ed!

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user




-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to