You might try <s:property value="name()"/>. I'm not sure if it will work, but OGNL has the ability to call methods by their full name. Also, if you haven't overridden toString() you can just use <s:property/> which will automatically call Authority.toString() which by default returns .name(). (*Chris*)
On Tue, Feb 1, 2011 at 5:03 AM, RogerV <roger.var...@googlemail.com> wrote: > > Hi > > I'm trying to iterate over a collection of Enums of type Authority using > > <s:iterator value="userDTO.authorities" status="authstatus"> > <s:property value="name"/> > <s:if > test="!#authstatus.last">,</s:if> > </s:iterator> > > but I'm not getting any values displayed. Debugging shows that the call > getUserDTO().getAuthorities() is being made on my underlying action and a > correctly populated List<Authority> is being returned. > > I was wondering if the problem is with the <s:property value="name"/> as > there is no Enum.getName() method, it's Enum.name(). How do I deal with > method names that don't follow the "bean convention"? > > Regards > -- > View this message in context: > http://old.nabble.com/Struts-2-obtaining-a-property-value-with-no-corresponding-getXX%28%29-method-tp30815951p30815951.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >