struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriel Belingueres" <belingue...@gmail.com>
Subject [S2] non intuitive OGNL value evaluation?
Date Wed, 27 Aug 2008 15:15:36 GMT
Hi,

Please see this lines:

<s:property value='#parameters.eventoId'/><br/>
<s:property value='%{"hello" + #parameters.eventoId}'/><br/>
<s:property value='%{"hello" + #parameters.eventoId[0]}'/>

Let's say that parameter eventoId == 9, it outputs:

9
hello[Ljava.lang.String;@144c5bb
hello9

The funny thing is that #parameters.eventoId' is evaluated to String
when it's alone (what I expected to be), but it is evaluated to an
String array when concatenated like in "hello" + #parameters.eventoId.
As expected, taking the first array element ([0]) solves the problem.

But the question is if this is OK to be this way, am I building the
OGNL expression wrongly, or is it some bug in the OGNL evaluation
code?

Gabriel

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


Mime
View raw message