struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wes Wannemacher <>
Subject Re: Display only 100 chars of a string
Date Mon, 22 Jun 2009 16:30:39 GMT
On Mon, Jun 22, 2009 at 12:26 PM, Stefano
Tranquillini<> wrote:
> are you sure that this thing works?
> because i don't see anything.
> I'm inside an iterator , with this thing works  <s:property
> value="%{description}" /> with yours no.
> seems that description is empty when i do <s:property
> value="@java.lang.String@format('%.100s', description)" />

In his example, the stack is searched for a property called
'description', in the new version of the tag, you probably have to
explicitly tell OGNL where to find 'description'. Try the following -

<s:property value="@java.lang.String@format('%.100s', #top.description)" />

(I think it's #top, but I could be wrong, perhaps one of the OGNL
gurus can chime in).

Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message