You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by xianwinwin <xi...@gmail.com> on 2008/06/27 00:34:09 UTC

- how to provide an understandable error message to the enduser?

Hi all,

If the end-user input wrong date-type (eg., date format is incorrect, or for
'number of people' he types 'Q') the 'input' is fired and it shows the error
message.

I do that with the 'return input' and the jsp page (this is ajax-id) looks
like this:


<%@ taglib prefix="s" uri="/struts-tags" %>

udpate Fail<BR>
<s:fielderror />


the problem is that the user see something like this:
Update fail:
Invalid field value for field "Car.returnDate".

obviously returnDate is a field name in Car (that's great for the
developers); but my question is this: How can I show a nice understandable
error message such as: 'error with car return date'


thanks for any pointers
* once again, this is only when the data-type is incorrect. 

-- 
View this message in context: http://www.nabble.com/%3Cs%3Afielderror--%3E----how-to-provide-an-understandable-error-message-to-the-enduser--tp18144819p18144819.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: - how to provide an understandable error message to the enduser?

Posted by xianwinwin <xi...@gmail.com>.
GOT IT!!!!

thanks Dave!


newton.dave wrote:
> 
> --- On Fri, 6/27/08, xianwinwin <xi...@gmail.com> wrote:
>> removed - so the conversionError is not working. ok, how can
>> I provide my own errors now? 
> 
> Doesn't your existing validation handle the results of a failed
> conversion? i.e., the property would be null (or whatever)?
> 
> Dave
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%3Cs%3Afielderror--%3E----how-to-provide-an-understandable-error-message-to-the-enduser--tp18144819p18158441.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: - how to provide an understandable error message to the enduser?

Posted by Dave Newton <ne...@yahoo.com>.
--- On Fri, 6/27/08, xianwinwin <xi...@gmail.com> wrote:
> removed - so the conversionError is not working. ok, how can
> I provide my own errors now? 

Doesn't your existing validation handle the results of a failed conversion? i.e., the property would be null (or whatever)?

Dave


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


Re: - how to provide an understandable error message to the enduser?

Posted by xianwinwin <xi...@gmail.com>.
removed - so the conversionError is not working. ok, how can I provide my own
errors now? 
- is it possible using notation for that? 

thanks Dave


newton.dave wrote:
> 
> --- On Fri, 6/27/08, xianwinwin <xi...@gmail.com> wrote:
>> I'm not sure I fully understand your reply;
>> I found the interceptor validatoin
>>   <interceptor-ref name="validation" />
>> assuming I remove it, as you suggested, what should come
>> instead and how can I configure the error messages. 
> 
>> newton.dave wrote:
>>> Among the options is to remove the
>>> ****conversion error interceptor**** <<
>>> from your interceptor stack and use 
>>> only the validation errors.
> 
> Dave
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%3Cs%3Afielderror--%3E----how-to-provide-an-understandable-error-message-to-the-enduser--tp18144819p18156267.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: - how to provide an understandable error message to the enduser?

Posted by Dave Newton <ne...@yahoo.com>.
--- On Fri, 6/27/08, xianwinwin <xi...@gmail.com> wrote:
> I'm not sure I fully understand your reply;
> I found the interceptor validatoin
>   <interceptor-ref name="validation" />
> assuming I remove it, as you suggested, what should come
> instead and how can I configure the error messages. 

> newton.dave wrote:
>> Among the options is to remove the
>> ****conversion error interceptor**** <<
>> from your interceptor stack and use 
>> only the validation errors.

Dave


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


Re: - how to provide an understandable error message to the enduser?

Posted by xianwinwin <xi...@gmail.com>.
Hi Dave,
I'm not sure I fully understand your reply;
I found the interceptor validatoin

                <interceptor-ref name="validation" />

assuming I remove it, as you suggested, what should come instead and how can
I configure the error messages. 

thank you



newton.dave wrote:
> 
> Type conversion errors are added separately from validation errors.
> 
> Among the options is to remove the conversion error interceptor from your
> interceptor stack and use only the validation errors.
> 
> Dave
> 
> --- On Thu, 6/26/08, xianwinwin <xi...@gmail.com> wrote:
> 
>> From: xianwinwin <xi...@gmail.com>
>> Subject: <s:fielderror />  - how to provide an understandable error
>> message to the enduser?
>> To: user@struts.apache.org
>> Date: Thursday, June 26, 2008, 6:35 PM
>> Hi all,
>> 
>> If the end-user input wrong date-type (eg., date format is
>> incorrect, or for
>> 'number of people' he types 'Q') the
>> 'input' is fired and it shows the error
>> message.
>> 
>> I do that with the 'return input' and the jsp page
>> (this is ajax-id) looks
>> like this:
>> 
>> 
>> <%@ taglib prefix="s"
>> uri="/struts-tags" %>
>> 
>> udpate Fail<BR>
>> <s:fielderror />
>> 
>> 
>> the problem is that the user see something like this:
>> Update fail:
>> Invalid field value for field "Car.returnDate".
>> 
>> obviously returnDate is a field name in Car (that's
>> great for the
>> developers); but my question is this: How can I show a nice
>> understandable
>> error message such as: 'error with car return date'
>> 
>> 
>> thanks for any pointers
>> * once again, this is only when the data-type is incorrect.
>> 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/%3Cs%3Afielderror--%3E----how-to-provide-an-understandable-error-message-to-the-enduser--tp18144819p18144819.html
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%3Cs%3Afielderror--%3E----how-to-provide-an-understandable-error-message-to-the-enduser--tp18144819p18154826.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: - how to provide an understandable error message to the enduser?

Posted by Dave Newton <ne...@yahoo.com>.
Type conversion errors are added separately from validation errors.

Among the options is to remove the conversion error interceptor from your interceptor stack and use only the validation errors.

Dave

--- On Thu, 6/26/08, xianwinwin <xi...@gmail.com> wrote:

> From: xianwinwin <xi...@gmail.com>
> Subject: <s:fielderror />  - how to provide an understandable error message to the enduser?
> To: user@struts.apache.org
> Date: Thursday, June 26, 2008, 6:35 PM
> Hi all,
> 
> If the end-user input wrong date-type (eg., date format is
> incorrect, or for
> 'number of people' he types 'Q') the
> 'input' is fired and it shows the error
> message.
> 
> I do that with the 'return input' and the jsp page
> (this is ajax-id) looks
> like this:
> 
> 
> <%@ taglib prefix="s"
> uri="/struts-tags" %>
> 
> udpate Fail<BR>
> <s:fielderror />
> 
> 
> the problem is that the user see something like this:
> Update fail:
> Invalid field value for field "Car.returnDate".
> 
> obviously returnDate is a field name in Car (that's
> great for the
> developers); but my question is this: How can I show a nice
> understandable
> error message such as: 'error with car return date'
> 
> 
> thanks for any pointers
> * once again, this is only when the data-type is incorrect.
> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/%3Cs%3Afielderror--%3E----how-to-provide-an-understandable-error-message-to-the-enduser--tp18144819p18144819.html
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org

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