You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dustin Frazier <du...@philanthropix.org> on 2003/08/19 20:50:01 UTC
using OGNL to concat strings, string bindings
I'm trying to use OGNL in a Tapestry expression to concatenate a string made
up of strings and string binding values. I want to do something like:
<td jwcid="@Any" element="td" style="ognl:'height:' + height"> ...
Where 'height' is a parameter that's defined on the component (of type
String). I keep getting errors from OGNL trying to parse the expression:
java.lang.NullPointerException
ognl.OgnlOps.getNumericType(OgnlOps.java:168)
ognl.OgnlOps.getNumericType(OgnlOps.java:234)
ognl.OgnlOps.add(OgnlOps.java:429)
...
I've also tried height.toString(), which still gives a NullPointerException
(this time in OgnlRuntime.callMethod), and height.string (thinking that
'height' actually resolves to the binding object itself), but no. I even
tried changing the 'height' parameter to an Integer, but it didn't seem to
make any difference.
Am I missing something really obvious here?
Dustin
Re: using OGNL to concat strings, string bindings
Posted by Drew Davidson <dr...@ognl.org>.
Dustin Frazier wrote:
>Never mind... This turned out to be a bug in the distributed version of OGNL
>(2.5.1). Everything seems to work as expected in the latest version
>(2.6.3)...
>
>
This behaviour changed in 2.6.3 in fact. I changed it because the
default concat behaviour of Strings in Java is to concat "null" for a
null pointer rather than throw an exception.
- Drew
--
+---------------------------------+
< Drew Davidson | OGNL Technology >
< Professional Open Source >
+---------------------------------+
| Email: drew@ognl.org /
| Web: http://www.ognl.org /
| Vox: (520) 531-1966 <
| Fax: (520) 531-1965 \
| Mobile: (520) 405-2967 \
+---------------------------------+
RE: using OGNL to concat strings, string bindings
Posted by Dustin Frazier <du...@philanthropix.org>.
Never mind... This turned out to be a bug in the distributed version of OGNL
(2.5.1). Everything seems to work as expected in the latest version
(2.6.3)...
Dustin
-----Original Message-----
From: Dustin Frazier [mailto:dustin@philanthropix.org]
Sent: Tuesday, August 19, 2003 11:50 AM
To: tapestry-user@jakarta.apache.org
Subject: using OGNL to concat strings, string bindings
I'm trying to use OGNL in a Tapestry expression to concatenate a string made
up of strings and string binding values. I want to do something like:
<td jwcid="@Any" element="td" style="ognl:'height:' + height"> ...
Where 'height' is a parameter that's defined on the component (of type
String). I keep getting errors from OGNL trying to parse the expression:
java.lang.NullPointerException
ognl.OgnlOps.getNumericType(OgnlOps.java:168)
ognl.OgnlOps.getNumericType(OgnlOps.java:234)
ognl.OgnlOps.add(OgnlOps.java:429)
...
I've also tried height.toString(), which still gives a NullPointerException
(this time in OgnlRuntime.callMethod), and height.string (thinking that
'height' actually resolves to the binding object itself), but no. I even
tried changing the 'height' parameter to an Integer, but it didn't seem to
make any difference.
Am I missing something really obvious here?
Dustin
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org