You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Daniel Lipofsky <da...@bricsnet.com> on 2004/06/18 00:21:58 UTC

bean:message and null or empty keys

I have this problem with bean:message.  I would like it to output
nothing if the key is null or empty.  I tried these 2 forms:

<bean:message bundle="myBundle" name="MyForm" property="myProp"/>
<bean-el:message bundle="myBundle" key="${MyForm.myProp}"/>

But I get ???en_US.null??? or ???en_US.??? for these.  If I set
null="true" in my message resources they throw exceptions instead.

Also if myProp is an Integer the first form doesn't work
because apparently there is no automatic type conversion (why?!?!).

Any good workarounds for these problems?
I guess I can wrap everything in logic tags, but that makes
the page big and clunky (and sometimes I run into the 64k limit).
Thanks,
Dan


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