struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wes Wannemacher <w...@wantii.com>
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<stefano.tranquillini@gmail.com> 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
-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message