Tsang, F (Fred) wrote:
> Hi Reg,
>
> I've found that you need to put a scope in the name property, like the
> following(in your case):
>
> <display:table name="sessionScope.testdata">
> </display:table>
>
> you can also use request scope:
>
> <display:table name="requestScope.testdata">
> </display:table>
requestScope is the default I believe. So if your list is in the request
scope, you shouldn't need to specify that. Check that with the docs
though.
> I notice though that it doesn't work (either session or request scope)
> when returning a spring MVC ModelAndView object. If anyone on the dev
> team could comment? ie.
>
> Map model = new Map();
> List testdata = new ArrayList();
> ... put some items here
> model.put("testdata", testdata);
> return new ModelAndView("test.jsp", model);
It depends on how you're accessing this in the <display:table> tag. You
can't just specify "testdata," you need to reference it through the model.
So in this case, you'd have something like:
<display:table name="model.testdata" uid="datum">
...
</display:table>
And that should do it. If you're having issues with that, look at the
scope in which the model is stored. The other possible complicating
factor is that I know EL evaluation deals with Map keys properly (check
out how BeanUtils handles it, for example), but displaytag doesn't use
exactly the same standards (or at least didn't use to; 1.1 may be using
BeanUtils), so if it's not working properly through a map, try creating a
bean with get/set methods for your properties. But I'm pretty certain it
does work with a map, although all the examples I'm finding in my own code
are with getters.
--
Rick Herrick
[EMAIL PROTECTED]
I haven't got time for inner peace.
"No reasonable definition of reality could be expected to permit
this."--Albert Einstein, Boris Podolsky and Nathan Rosen in 1935
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user