You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Arpan Debroy <ar...@gmail.com> on 2008/05/16 08:30:26 UTC

How to change automatic type conversion error message

In my application  "id" attribute is int type of "Group" bean.

In my JSP I have written like that :-

<s:textfield name="group.id" value="%{group.id}"/>

Now if user puts a string into this text field, then error message come like
that

*invalid value for the field group.id

But I want to show the error message with only "id" not "group.id".

Is there anybody, who can show me any example how to do that.
*

Re: How to change automatic type conversion error message

Posted by Arpan Debroy <ar...@gmail.com>.
It looks nice..thanks for the help..

On Fri, May 16, 2008 at 5:07 PM, Alberto A. Flores <aa...@gmail.com>
wrote:

> Read the section "Type Conversion Error Handling" in:
>
> http://struts.apache.org/2.x/docs/type-conversion.html
>
> You need to define an "invalid.fieldvalue.<your property>" to do custom
> type conversion error.
>
> Arpan Debroy wrote:
>
>> In my application  "id" attribute is int type of "Group" bean.
>>
>> In my JSP I have written like that :-
>>
>> <s:textfield name="group.id" value="%{group.id}"/>
>>
>> Now if user puts a string into this text field, then error message come
>> like
>> that
>>
>> *invalid value for the field group.id
>>
>> But I want to show the error message with only "id" not "group.id".
>>
>> Is there anybody, who can show me any example how to do that.
>> *
>>
>>
> --
>
> Alberto A. Flores
> http://www.linkedin.com/in/aflores
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

Re: How to change automatic type conversion error message

Posted by "Alberto A. Flores" <aa...@gmail.com>.
Read the section "Type Conversion Error Handling" in:

http://struts.apache.org/2.x/docs/type-conversion.html

You need to define an "invalid.fieldvalue.<your property>" to do custom 
type conversion error.

Arpan Debroy wrote:
> In my application  "id" attribute is int type of "Group" bean.
> 
> In my JSP I have written like that :-
> 
> <s:textfield name="group.id" value="%{group.id}"/>
> 
> Now if user puts a string into this text field, then error message come like
> that
> 
> *invalid value for the field group.id
> 
> But I want to show the error message with only "id" not "group.id".
> 
> Is there anybody, who can show me any example how to do that.
> *
> 

-- 

Alberto A. Flores
http://www.linkedin.com/in/aflores