You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Derrick Koes <De...@skillsoft.com> on 2009/04/01 20:00:54 UTC

NPE in Visitor Validation migrating from 2.0.14 to 2.1.6

If I attempt to use an empty message node in my visitor validator
configuration, I get a NullPointerException from
TextParseUtil.translateVariables (line 155) because "expression" (the
default message if message key is null) is null.

 

I can sort of work around the issue by adding a default message, but
then that string is prepending (according to guide and as witnessed) to
the validation error string.  I do not want this string appended.

 

Does anyone have any suggestions?

 

<field name="userBean">

            <field-validator type="visitor">

                        <message key=" "></message>

            </field-validator>

</field>

 

BTW, other forms such as "<message key=""></message>", "<message/>", and
"<message></message>" all produce the same problem.

 

Thanks,

Derrick


Re: NPE in Visitor Validation migrating from 2.0.14 to 2.1.6

Posted by Musachy Barroso <mu...@gmail.com>.
This was fixed in xwork trunk(yesterday). I can't find the ticket now :)

musachy

On Wed, Apr 1, 2009 at 2:00 PM, Derrick Koes <De...@skillsoft.com> wrote:
> If I attempt to use an empty message node in my visitor validator
> configuration, I get a NullPointerException from
> TextParseUtil.translateVariables (line 155) because "expression" (the
> default message if message key is null) is null.
>
>
>
> I can sort of work around the issue by adding a default message, but
> then that string is prepending (according to guide and as witnessed) to
> the validation error string.  I do not want this string appended.
>
>
>
> Does anyone have any suggestions?
>
>
>
> <field name="userBean">
>
>            <field-validator type="visitor">
>
>                        <message key=" "></message>
>
>            </field-validator>
>
> </field>
>
>
>
> BTW, other forms such as "<message key=""></message>", "<message/>", and
> "<message></message>" all produce the same problem.
>
>
>
> Thanks,
>
> Derrick
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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