Re: Query in action messages

2006-11-15 Thread Hanmay Udgiri

Hi Nuwan,
Actually I am using Form and this method is available in Action class

On 11/15/06, Nuwan Chandrasoma <[EMAIL PROTECTED]> wrote:


Ops..,, sorry ignore the last mail..

It should be.. first call the getResources() and get the MessageResource
and
from there u can get the message..

eg:-

errors.add(Error_FIELD_KEY,new ActionMessage("
error.required",getResources(request).getMessage("error.zipcode"));

Regards,

Nuwan



- Original Message -
From: "Hanmay Udgiri" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, November 15, 2006 8:25 AM
Subject: Query in action messages


> Hi
> I am doing validation in my Action Form which is extending
> ValidatorActionForm.
> In validate method,I am checking for mandatory field and adding error.
> The error in ApplicationResources.properties is like this.
> error.required=The {0) field is required field.
> error.notInRange=The {0} field should be in between {1) and {2)
> error.zipcode=Zip Code
> And I am addding the the error in validate mehod like this
> errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","
> error.zipcode"));
>
> But It is printing the error mesasges like this.
> The error.zipcode field in reuqired field.
> It works if I add error like this.
> errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","Zip
> Code"));
> The Zip Code field in reuqired field.
>
> Can anybody help on this
>
> --
> Thanks and Regards
> Hanmayya Udgiri
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Thanks and Regards
Hanmayya Udgiri


RE: Query in action messages

2006-11-15 Thread Anil Kumar T

I was wrong... ignore my earlier mail..
Thanks.
Anil.

-Original Message-
From: Hanmay Udgiri [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 15, 2006 1:56 PM
To: user@struts.apache.org
Subject: Query in action messages

Hi
I am doing validation in my Action Form which is extending
ValidatorActionForm.
In validate method,I am checking for mandatory field and adding error.
The error in ApplicationResources.properties is like this.
error.required=The {0) field is required field.
error.notInRange=The {0} field should be in between {1) and {2)
error.zipcode=Zip Code
And I am addding the the error in validate mehod like this
errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","
error.zipcode"));

But It is printing the error mesasges like this.
The error.zipcode field in reuqired field.
It works if I add error like this.
errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","Zip
Code"));
The Zip Code field in reuqired field.

Can anybody help on this

--
Thanks and Regards
Hanmayya Udgiri

Information transmitted by this e-mail is proprietary to Infinite Computer 
Solutions and / or its Customers and is intended for use only by the individual 
or the entity to which it is addressed, and may contain information that is 
privileged, confidential or exempt from disclosure under applicable law. If you 
are not the intended recipient or it appears that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination 
of this information in any manner is strictly prohibited. In such cases, please 
notify us immediately at [EMAIL PROTECTED] and delete this email from your 
records.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Query in action messages

2006-11-15 Thread Anil Kumar T

There is empty space before the key.. just observe..



errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","Zip
Code"));



should like ...



errors.add(Error_FIELD_KEY,new ActionMessage("error.required","Zip
Code"));



hope it helps you...



Anil.



-Original Message-
From: Hanmay Udgiri [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 15, 2006 1:56 PM
To: user@struts.apache.org
Subject: Query in action messages



Hi

I am doing validation in my Action Form which is extending

ValidatorActionForm.

In validate method,I am checking for mandatory field and adding error.

The error in ApplicationResources.properties is like this.

error.required=The {0) field is required field.

error.notInRange=The {0} field should be in between {1) and {2)

error.zipcode=Zip Code

And I am addding the the error in validate mehod like this

errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","

error.zipcode"));



But It is printing the error mesasges like this.

The error.zipcode field in reuqired field.

It works if I add error like this.

errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","Zip
Code"));

The Zip Code field in reuqired field.



Can anybody help on this



--

Thanks and Regards

Hanmayya Udgiri



Information transmitted by this e-mail is proprietary to Infinite Computer 
Solutions and / or its Customers and is intended for use only by the individual 
or the entity to which it is addressed, and may contain information that is 
privileged, confidential or exempt from disclosure under applicable law. If you 
are not the intended recipient or it appears that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination 
of this information in any manner is strictly prohibited. In such cases, please 
notify us immediately at [EMAIL PROTECTED] and delete this email from your 
records.

RE: Query in action messages

2006-11-15 Thread Mano Chinthaka Dasanayaka
Hi,
Yes. When u use. errors.add(Error_FIELD_KEY,new ActionMessage("
error.required","
error.zipcode"));

It will just replace what ever u pass as the second argument with the 
"{0)". Second way is correct...
Regards,
Mano 


-Original Message-
From: Hanmay Udgiri [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 15, 2006 1:56 PM
To: user@struts.apache.org
Subject: Query in action messages

Hi
I am doing validation in my Action Form which is extending
ValidatorActionForm.
In validate method,I am checking for mandatory field and adding error.
The error in ApplicationResources.properties is like this.
error.required=The {0) field is required field.
error.notInRange=The {0} field should be in between {1) and {2)
error.zipcode=Zip Code
And I am addding the the error in validate mehod like this
errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","
error.zipcode"));

But It is printing the error mesasges like this.
The error.zipcode field in reuqired field.
It works if I add error like this.
errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","Zip Code"));
The Zip Code field in reuqired field.

Can anybody help on this

-- 
Thanks and Regards
Hanmayya Udgiri



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Query in action messages

2006-11-15 Thread Nuwan Chandrasoma

Ops..,, sorry ignore the last mail..

It should be.. first call the getResources() and get the MessageResource and 
from there u can get the message..


eg:-

errors.add(Error_FIELD_KEY,new ActionMessage(" 
error.required",getResources(request).getMessage("error.zipcode"));


Regards,

Nuwan



- Original Message - 
From: "Hanmay Udgiri" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, November 15, 2006 8:25 AM
Subject: Query in action messages



Hi
I am doing validation in my Action Form which is extending
ValidatorActionForm.
In validate method,I am checking for mandatory field and adding error.
The error in ApplicationResources.properties is like this.
error.required=The {0) field is required field.
error.notInRange=The {0} field should be in between {1) and {2)
error.zipcode=Zip Code
And I am addding the the error in validate mehod like this
errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","
error.zipcode"));

But It is printing the error mesasges like this.
The error.zipcode field in reuqired field.
It works if I add error like this.
errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","Zip 
Code"));

The Zip Code field in reuqired field.

Can anybody help on this

--
Thanks and Regards
Hanmayya Udgiri




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Query in action messages

2006-11-15 Thread Nuwan Chandrasoma

Hi,

there is a method called getMessage(), use that one and get the message from 
the resource bundle,


eg:_

errors.add(Error_FIELD_KEY,new ActionMessage(" error.required", 
getMessage("error.zipcode")));


Regards,

Nuwan

- Original Message - 
From: "Hanmay Udgiri" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, November 15, 2006 8:25 AM
Subject: Query in action messages



Hi
I am doing validation in my Action Form which is extending
ValidatorActionForm.
In validate method,I am checking for mandatory field and adding error.
The error in ApplicationResources.properties is like this.
error.required=The {0) field is required field.
error.notInRange=The {0} field should be in between {1) and {2)
error.zipcode=Zip Code
And I am addding the the error in validate mehod like this
errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","
error.zipcode"));

But It is printing the error mesasges like this.
The error.zipcode field in reuqired field.
It works if I add error like this.
errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","Zip 
Code"));

The Zip Code field in reuqired field.

Can anybody help on this

--
Thanks and Regards
Hanmayya Udgiri




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Query in action messages

2006-11-15 Thread Hanmay Udgiri

Hi
I am doing validation in my Action Form which is extending
ValidatorActionForm.
In validate method,I am checking for mandatory field and adding error.
The error in ApplicationResources.properties is like this.
error.required=The {0) field is required field.
error.notInRange=The {0} field should be in between {1) and {2)
error.zipcode=Zip Code
And I am addding the the error in validate mehod like this
errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","
error.zipcode"));

But It is printing the error mesasges like this.
The error.zipcode field in reuqired field.
It works if I add error like this.
errors.add(Error_FIELD_KEY,new ActionMessage(" error.required","Zip Code"));
The Zip Code field in reuqired field.

Can anybody help on this

--
Thanks and Regards
Hanmayya Udgiri


Query in Action messages

2006-11-14 Thread Hanmay Udgiri

Hi
I am doing validation in my Action Form which is extending
ValidatorActionForm.
In validate method,I am checking for mandatory field and adding error.
The error in ApplicationResources.properties is like this.
error.required=The {0) field is required field.
error.notInRange=The {0} field should be in between {1) and {2)
error.zipcode=Zip Code
And I am addding the the error in validate mehod like this
errors.add(Error_FIELD_KEY,new ActionMessage("error.required","error.zipcode
"));

But It is printing the error mesasges like this.
The error.zipcode field in reuqired field.
It works if I add error like this.
errors.add(Error_FIELD_KEY,new ActionMessage("error.required","Zip Code"));
The Zip Code field in reuqired field.

Can anybody help on this


--
Thanks and Regards
Hanmayya Udgiri