You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ma...@virginmoney.com on 2007/07/10 14:37:15 UTC

Struts 2 validation error messages

Hi,

I have written my customised java class to do the form validation within
the action class.
I want to render the validation error messages from a property file and not
hard coding it into the code.

What i understand is the struts ActionSupport class has
addActionError(String msg)  which takes a error messages,
Can anyone help me how can I set the error key in the validation class?

Manoj.


This e-mail is intended to be confidential to the recipient. If you receive a copy in error, please inform the sender and then delete this message. Virgin Money do not accept responsibility for changes made to any e-mail after sending. Virgin Money have swept, and believe this e-mail to be free of viruses and profanity but make no guarantees to this effect.

Virgin Money Personal Financial Service Ltd is authorised and regulated by the Financial Services Authority. Registered in England no. 3072766. Entered on the Financial Services Authority's Register http://www.fsa.gov.uk/register/. Register Number 179271. The Virgin Deposit Account is a personal bank account with The Royal Bank of Scotland.

Virgin Money Unit Trust Managers Ltd is authorised and regulated by the Financial Services Authority. Registered in England no. 3000482. Entered on the Financial Services Authority's Register. Register Number 171748.

Virgin Money Ltd. Registered in England no. 4232392. Introducer appointed representative only of Virgin Money Personal Financial Service Ltd.

Virgin Money Management Services Ltd. Registered in England no.3072772.

Virgin Money Group Ltd. Registered in England no.3087587.

All the above companies have their Registered office at Discovery House, Whiting Road, Norwich NR4 6EJ. 

All products are open only to residents of the United Kingdom.

This message has been checked for viruses and spam by the Virgin Money email scanning system powered by Messagelabs.

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


Re: Struts 2 validation error messages

Posted by Don Brown <do...@gmail.com>.
Just use the getText() method to resolve the key of your choice.  For
example: addActionError(getText("my.message.key"));

Don

On 7/10/07, Manoj.Gupta@virginmoney.com <Ma...@virginmoney.com> wrote:
> Hi,
>
> I have written my customised java class to do the form validation within
> the action class.
> I want to render the validation error messages from a property file and not
> hard coding it into the code.
>
> What i understand is the struts ActionSupport class has
> addActionError(String msg)  which takes a error messages,
> Can anyone help me how can I set the error key in the validation class?
>
> Manoj.
>
>
> This e-mail is intended to be confidential to the recipient. If you receive a copy in error, please inform the sender and then delete this message. Virgin Money do not accept responsibility for changes made to any e-mail after sending. Virgin Money have swept, and believe this e-mail to be free of viruses and profanity but make no guarantees to this effect.
>
> Virgin Money Personal Financial Service Ltd is authorised and regulated by the Financial Services Authority. Registered in England no. 3072766. Entered on the Financial Services Authority's Register http://www.fsa.gov.uk/register/. Register Number 179271. The Virgin Deposit Account is a personal bank account with The Royal Bank of Scotland.
>
> Virgin Money Unit Trust Managers Ltd is authorised and regulated by the Financial Services Authority. Registered in England no. 3000482. Entered on the Financial Services Authority's Register. Register Number 171748.
>
> Virgin Money Ltd. Registered in England no. 4232392. Introducer appointed representative only of Virgin Money Personal Financial Service Ltd.
>
> Virgin Money Management Services Ltd. Registered in England no.3072772.
>
> Virgin Money Group Ltd. Registered in England no.3087587.
>
> All the above companies have their Registered office at Discovery House, Whiting Road, Norwich NR4 6EJ.
>
> All products are open only to residents of the United Kingdom.
>
> This message has been checked for viruses and spam by the Virgin Money email scanning system powered by Messagelabs.
>
> ---------------------------------------------------------------------
> 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