Re: How to retrieve all action messages in java code

2010-04-11 Thread dusty

When you are talking about action messages it is not a hash map with a key. 
It is a simple Collection.  ActionSupport has a method
getActionMessages() that returns this string collection.

Field errors are a different matter.  These come through as a Map>.  You get that map through getFieldErrors().




luy wrote:
> 
> Good afternoon,
> 
> I'd like to know
> (1) how to get all action messages in java code
> (2) How to remove some action message from ActionMessages
> 
> 
> Something like (1) returns
> 
> ActionMessage("key1")
> ActionMessage("key2")
> ...
> 
> ActionMessage("keyN")
> 
> 
> (2) removes key1...key9
> 
> Thanks a lot!
> -- 
> Lu Ying
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/How-to-retrieve-all-action-messages-in-java-code-tp28196001p28213359.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



How to retrieve all action messages in java code

2010-04-09 Thread Emi Lu

Good afternoon,

I'd like to know
(1) how to get all action messages in java code
(2) How to remove some action message from ActionMessages


Something like (1) returns

ActionMessage("key1")
ActionMessage("key2")
...

ActionMessage("keyN")


(2) removes key1...key9

Thanks a lot!
--
Lu Ying

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



RE: Preserving Action Messages during redirect action

2009-02-27 Thread Sundararaman, Anand
Thanks Felipe,
   This was quick. I will incorporate the Interceptor and check it out.

Thanks,
Anand


-Original Message-
From: Felipe Fraga [mailto:felipefr...@gmail.com] 
Sent: Friday, February 27, 2009 10:17 AM
To: Struts Users Mailing List
Subject: Re: Preserving Action Messages during redirect action

Glindholm solved this with an interceptor.

http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/

Best regards,

Felipe

On Fri, Feb 27, 2009 at 1:12 PM, Sundararaman, Anand
 wrote:
> Hi,
>   I want to redirect to another action but preserve the action 
> messages/errors from the previous action. Is there any standard way to 
> achieve this functionality in Struts 2? Or do I have to write an Interceptor 
> for this?
>
> I have a use case where the errors on a web screen needs to be shown on a 
> different screen to which I want to redirect since that action reloads data 
> from the database.
>
> Please let me know.
>
> Thanks in advance
> Anand
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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


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



Re: Preserving Action Messages during redirect action

2009-02-27 Thread Felipe Fraga
Glindholm solved this with an interceptor.

http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/

Best regards,

Felipe

On Fri, Feb 27, 2009 at 1:12 PM, Sundararaman, Anand
 wrote:
> Hi,
>   I want to redirect to another action but preserve the action 
> messages/errors from the previous action. Is there any standard way to 
> achieve this functionality in Struts 2? Or do I have to write an Interceptor 
> for this?
>
> I have a use case where the errors on a web screen needs to be shown on a 
> different screen to which I want to redirect since that action reloads data 
> from the database.
>
> Please let me know.
>
> Thanks in advance
> Anand
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Preserving Action Messages during redirect action

2009-02-27 Thread SanJ.SANJAY

Please use a new thread for this issue. The problem addressed here is totally
diffirent from yours.


Sundararaman, Anand wrote:
> 
> Hi,
>I want to redirect to another action but preserve the action
> messages/errors from the previous action. Is there any standard way to
> achieve this functionality in Struts 2? Or do I have to write an
> Interceptor for this?
> 
> I have a use case where the errors on a web screen needs to be shown on a
> different screen to which I want to redirect since that action reloads
> data from the database.
> 
> Please let me know.
> 
> Thanks in advance
> Anand
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Action-mapping-issue-while-Integrating-S2-and-S1-tp21982941p22249004.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Preserving Action Messages during redirect action

2009-02-27 Thread Sundararaman, Anand
Hi,
   I want to redirect to another action but preserve the action messages/errors 
from the previous action. Is there any standard way to achieve this 
functionality in Struts 2? Or do I have to write an Interceptor for this?

I have a use case where the errors on a web screen needs to be shown on a 
different screen to which I want to redirect since that action reloads data 
from the database.

Please let me know.

Thanks in advance
Anand


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



RE: Scope of action messages?

2008-04-01 Thread Allen, Daniel
Oh. Yeah, that one looks a lot more immediately applicable. :)

Thanks!
~DVA 

-Original Message-
From: Chris Pratt [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 01, 2008 2:45 PM
To: Struts Users Mailing List
Subject: Re: Scope of action messages?

None if you use the store interceptor (sorry, I had the interceptor
name wrong on the last mail).
  (*Chris*)

On Tue, Apr 1, 2008 at 11:22 AM, Allen, Daniel <[EMAIL PROTECTED]>
wrote:
> Hmmm...
>
>  How much interfering in the internals do you suppose I'd have to do
to
>  make action errors & messages hang around until the corresponding
>   tag is rendered?
>
>
>
>
>  -Original Message-
>  From: Chris Pratt [mailto:[EMAIL PROTECTED]
>  Sent: Tuesday, April 01, 2008 1:58 PM
>  To: Struts Users Mailing List
>  Subject: Re: Scope of action messages?
>
>  actionmessages, actionerrors and fielderrors are all request scope,
so
>  they'll be gone by the time the redirect comes back around.  You
might
>  want to look into the scope interceptor, it can help bridge the gap.
>   (*Chris*)
>
>  --
>
>
> This message may contain confidential, proprietary, or legally
privileged information. No confidentiality or privilege is waived by any
transmission to an unintended recipient. If you are not an intended
recipient, please notify the sender and delete this message immediately.
Any views expressed in this message are those of the sender, not those
of any entity within the KBC Financial Products group of companies
(together referred to as "KBC FP").
>
>  This message does not create any obligation, contractual or
otherwise, on the part of KBC FP. It is not an offer (or solicitation of
an offer) of, or a recommendation to buy or sell, any financial product.
Any prices or other values included in this message are indicative only,
and do not necessarily represent current market prices, prices at which
KBC FP would enter into a transaction, or prices at which similar
transactions may be carried on KBC FP's own books. The information
contained in this message is provided "as is", without representations
or warranties, express or implied, of any kind. Past performance is not
indicative of future returns.
>
>
>  -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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


-- 
This message may contain confidential, proprietary, or legally privileged 
information. No confidentiality or privilege is waived by any transmission to 
an unintended recipient. If you are not an intended recipient, please notify 
the sender and delete this message immediately. Any views expressed in this 
message are those of the sender, not those of any entity within the KBC 
Financial Products group of companies (together referred to as "KBC FP"). 

This message does not create any obligation, contractual or otherwise, on the 
part of KBC FP. It is not an offer (or solicitation of an offer) of, or a 
recommendation to buy or sell, any financial product. Any prices or other 
values included in this message are indicative only, and do not necessarily 
represent current market prices, prices at which KBC FP would enter into a 
transaction, or prices at which similar transactions may be carried on KBC FP's 
own books. The information contained in this message is provided "as is", 
without representations or warranties, express or implied, of any kind. Past 
performance is not indicative of future returns.


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



Re: Scope of action messages?

2008-04-01 Thread Chris Pratt
None if you use the store interceptor (sorry, I had the interceptor
name wrong on the last mail).
  (*Chris*)

On Tue, Apr 1, 2008 at 11:22 AM, Allen, Daniel <[EMAIL PROTECTED]> wrote:
> Hmmm...
>
>  How much interfering in the internals do you suppose I'd have to do to
>  make action errors & messages hang around until the corresponding
>   tag is rendered?
>
>
>
>
>  -Original Message-
>  From: Chris Pratt [mailto:[EMAIL PROTECTED]
>  Sent: Tuesday, April 01, 2008 1:58 PM
>  To: Struts Users Mailing List
>  Subject: Re: Scope of action messages?
>
>  actionmessages, actionerrors and fielderrors are all request scope, so
>  they'll be gone by the time the redirect comes back around.  You might
>  want to look into the scope interceptor, it can help bridge the gap.
>   (*Chris*)
>
>  --
>
>
> This message may contain confidential, proprietary, or legally privileged 
> information. No confidentiality or privilege is waived by any transmission to 
> an unintended recipient. If you are not an intended recipient, please notify 
> the sender and delete this message immediately. Any views expressed in this 
> message are those of the sender, not those of any entity within the KBC 
> Financial Products group of companies (together referred to as "KBC FP").
>
>  This message does not create any obligation, contractual or otherwise, on 
> the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a 
> recommendation to buy or sell, any financial product. Any prices or other 
> values included in this message are indicative only, and do not necessarily 
> represent current market prices, prices at which KBC FP would enter into a 
> transaction, or prices at which similar transactions may be carried on KBC 
> FP's own books. The information contained in this message is provided "as 
> is", without representations or warranties, express or implied, of any kind. 
> Past performance is not indicative of future returns.
>
>
>  -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



RE: Scope of action messages?

2008-04-01 Thread Allen, Daniel
Hmmm...

How much interfering in the internals do you suppose I'd have to do to
make action errors & messages hang around until the corresponding
 tag is rendered?



-Original Message-
From: Chris Pratt [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 01, 2008 1:58 PM
To: Struts Users Mailing List
Subject: Re: Scope of action messages?

actionmessages, actionerrors and fielderrors are all request scope, so
they'll be gone by the time the redirect comes back around.  You might
want to look into the scope interceptor, it can help bridge the gap.
  (*Chris*)

-- 
This message may contain confidential, proprietary, or legally privileged 
information. No confidentiality or privilege is waived by any transmission to 
an unintended recipient. If you are not an intended recipient, please notify 
the sender and delete this message immediately. Any views expressed in this 
message are those of the sender, not those of any entity within the KBC 
Financial Products group of companies (together referred to as "KBC FP"). 

This message does not create any obligation, contractual or otherwise, on the 
part of KBC FP. It is not an offer (or solicitation of an offer) of, or a 
recommendation to buy or sell, any financial product. Any prices or other 
values included in this message are indicative only, and do not necessarily 
represent current market prices, prices at which KBC FP would enter into a 
transaction, or prices at which similar transactions may be carried on KBC FP's 
own books. The information contained in this message is provided "as is", 
without representations or warranties, express or implied, of any kind. Past 
performance is not indicative of future returns.


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



Re: Scope of action messages?

2008-04-01 Thread Chris Pratt
actionmessages, actionerrors and fielderrors are all request scope, so
they'll be gone by the time the redirect comes back around.  You might
want to look into the scope interceptor, it can help bridge the gap.
  (*Chris*)

On Tue, Apr 1, 2008 at 10:50 AM, Allen, Daniel <[EMAIL PROTECTED]> wrote:
> Hi, all.
>
>  I'm trying to display a message to the user to confirm that a new user
>  was created, basic par-for-the-course concept. However, I'm finding that
>  my  tag doesn't render to anything. The first thing I
>  thought of was that my result for the user creation is an
>  action-redirect, so by the time we get to the JSP that shows action
>  messages, another whole action has executed. Do action messages have a
>  limited scope, i.e. are they being lost because we started a new action?
>
>  Thanks,
>  Dan Allen
>
>  --
>  This message may contain confidential, proprietary, or legally privileged 
> information. No confidentiality or privilege is waived by any transmission to 
> an unintended recipient. If you are not an intended recipient, please notify 
> the sender and delete this message immediately. Any views expressed in this 
> message are those of the sender, not those of any entity within the KBC 
> Financial Products group of companies (together referred to as "KBC FP").
>
>  This message does not create any obligation, contractual or otherwise, on 
> the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a 
> recommendation to buy or sell, any financial product. Any prices or other 
> values included in this message are indicative only, and do not necessarily 
> represent current market prices, prices at which KBC FP would enter into a 
> transaction, or prices at which similar transactions may be carried on KBC 
> FP's own books. The information contained in this message is provided "as 
> is", without representations or warranties, express or implied, of any kind. 
> Past performance is not indicative of future returns.
>
>
>  -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Scope of action messages?

2008-04-01 Thread Allen, Daniel
Hi, all.

I'm trying to display a message to the user to confirm that a new user
was created, basic par-for-the-course concept. However, I'm finding that
my  tag doesn't render to anything. The first thing I
thought of was that my result for the user creation is an
action-redirect, so by the time we get to the JSP that shows action
messages, another whole action has executed. Do action messages have a
limited scope, i.e. are they being lost because we started a new action?

Thanks,
Dan Allen

-- 
This message may contain confidential, proprietary, or legally privileged 
information. No confidentiality or privilege is waived by any transmission to 
an unintended recipient. If you are not an intended recipient, please notify 
the sender and delete this message immediately. Any views expressed in this 
message are those of the sender, not those of any entity within the KBC 
Financial Products group of companies (together referred to as "KBC FP"). 

This message does not create any obligation, contractual or otherwise, on the 
part of KBC FP. It is not an offer (or solicitation of an offer) of, or a 
recommendation to buy or sell, any financial product. Any prices or other 
values included in this message are indicative only, and do not necessarily 
represent current market prices, prices at which KBC FP would enter into a 
transaction, or prices at which similar transactions may be carried on KBC FP's 
own books. The information contained in this message is provided "as is", 
without representations or warranties, express or implied, of any kind. Past 
performance is not indicative of future returns.


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



Re: struts + springs + action messages issue

2008-03-10 Thread Dave Newton
--- Sivaswamynatha K <[EMAIL PROTECTED]> wrote:
> We are using struts 1.2.9 and springs. I have one issue. Action messages
> (some error message and information to the user) of one user is
> available to another user who is also working on the application. He may
> do some other action.

What's the actual problem?

Without knowing anything about how your applications is set up or configured
I'd guess that you have non-thread-safe actions. S1 actions, like servlets,
must not have any shared information.

Dave


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



struts + springs + action messages issue

2008-03-10 Thread Sivaswamynatha K
Hi,

 

We are using struts 1.2.9 and springs. I have one issue. Action messages
(some error message and information to the user) of one user is
available to another user who is also working on the application. He may
do some other action.

 

Regards,

Siva

 

Regards,

K. Siva Swamynatha.

KAVNIYA Technology Solutions Pvt. Ltd.

Chennai.

 

Tomorrow belongs to the people who prepare for it today.

 



Re: struts 2 action messages / action errors

2007-10-24 Thread Jim Cushing
Struts 2 allows you to style them, but using themes. Themes are both  
more powerful and more complicated than what Struts 1 offered.


Before you dive into customizing a theme, see if you can style it  
entirely with CSS. You're best better is probably to "View source" in  
your browser to see the rendered HTML, noting the classes that the  
built-in themes use. Then, override these styles with your own  
stylesheet. Using the built-in css_xhtml theme (add  
struts.ui.theme=css_xhtml to struts.properties) will give you more  
flexibility, compared to the default theme (xhtml).


If that doesn't give you the look you want, it's time to dive into  
themes. Themes are documented here:


http://struts.apache.org/2.x/docs/themes-and-templates.html

http://struts.apache.org/2.x/docs/extending-themes.html

Mark Menard has provided an excellent tutorial on creating custom  
themes here:


http://www.vitarara.org/cms/struts_2_cookbook/creating_a_theme


On Oct 24, 2007, at 11:58 AM, Brian Relph wrote:

Does struts2 handle the css-styling of action errors and messages  
the same

as struts1?  In struts 1, i defined some keys in the message bundle
errors.prefix and errors.suffix that were automatically used to  
style the

html generated by the actionerrors.  Is this enabled in struts2?

Thanks,
Brian



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



struts 2 action messages / action errors

2007-10-24 Thread Brian Relph
Does struts2 handle the css-styling of action errors and messages the same
as struts1?  In struts 1, i defined some keys in the message bundle
errors.prefix and errors.suffix that were automatically used to style the
html generated by the actionerrors.  Is this enabled in struts2?

Thanks,
Brian


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


not able to populate action messages; corrosponding entries made in web.xml and struts-config.xml

2005-10-14 Thread varun ahluwalia
Following is the piece of code i am using to populate action message.
 ActionMessages msgs = new ActionMessages();
msgs.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("
error.notValidConfName"));
saveMessages(request, msgs);
 I am not able to get the message for the key "error.notValidConfName",
which i am storing in ApplicationResources.properties file kept under
WEB-INF/classes folder.
 in the web.xml the entry for ApplicationResources.properties is as
follows:-

action
org.apache.struts.action.ActionServlet

application
ApplicationResources


config
/WEB-INF/struts-config.xml

 and in struts.config.xml I have the entry for
ApplicationResources.properties as follows:-

 is there anything else required to be done. I think i have done all what it
takes to populate and action message from resource file.
 varun ahluwalia.
regards


Re: Related to Action Messages

2005-09-13 Thread Laurie Harper

Anuradha S.Athreya wrote:

I have about 5 messages which will be passed on from my Action -> View
(JSP) using ActionMessage. But at any time only one of these five messages
will be displayed in the View.

To accommodate every message in the JSP, Do I have to include this piece
of code repeatedly .












Or can I include some logic where in the 'property' will be populated
based on the message sent by the Action?


Just leave out the 'property' attribute entirely. The  
tag will loop through all available messages, rendering the tag body 
once for each message.


L.


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



Related to Action Messages

2005-09-12 Thread Anuradha S.Athreya

> I have about 5 messages which will be passed on from my Action -> View
> (JSP) using ActionMessage. But at any time only one of these five messages
> will be displayed in the View.
> 
> To accommodate every message in the JSP, Do I have to include this piece
> of code repeatedly .
>  property="<%=AllMessages.FirstMessage%>"  message='true'>
> 
> 
> 
>  property="<%=AllMessages.SecondMessage%>"  message='true'>
> 
> 
> 
>  property="<%=AllMessages.ThirdMessage%>"  message='true'>
> 
> 
> 
> Or can I include some logic where in the 'property' will be populated
> based on the message sent by the Action?
> 
> 


Re: Action Messages

2005-05-28 Thread Dakota Jack
Hi, Ray,

Why is what you are doing superior to the standard?  The standard is
something like the following and is very efficient, I think?


 
  

  
  

  



  

  
  
  

  



  

  

  
 

On 5/27/05, Ray Madigan <[EMAIL PROTECTED]> wrote:
> I am looking for the ability to handle the ActionMessage in a different way
> in my application.  In the validate method of the form I create a new
> instance of ActionErrors and add ActionMessage instances to it.  In the
> Action dispatch method I call validate and get a non empty ActionErrors
> instance.  To figure how to make this work, I can get the iterator to the
> keys and copy it to the request attribute like
> 
> Iterator iter = errors.properties ( );
> request.setAttribute ( "ERRORS", errors );
> 
> but I can't get the messages associated with the property to allow me to
> manipulate my page.
> 
> What I would like is:
> 
> for ActionErrors to be a collection, the I could iterate on the errors and
> get the key and the values.  I could iterate on the values, or reteive a
> specific one.
> 
> I want the ability to inspect an error condition and if it exists or not and
> generate jsp accordingly with an error message.
> 
> Does anyone know how to do this?
> 
> it would look like, but I dream too much
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: Action Messages

2005-05-28 Thread Adam Hardy

Ray,
it's not clear what you are trying to do that is different from 
standard. Struts puts the ActionErrors in the request by default. The 
Messages too.


I used to know this inside out but it's been a year or so... but I think 
the key is like this:


request.getAttribute(org.apache.struts.Globals.MESSAGE_KEY);
request.getAttribute(org.apache.struts.Globals.ERROR_KEY);




On 27/05/05 19:46 Ray Madigan wrote:

I am looking for the ability to handle the ActionMessage in a different way
in my application.  In the validate method of the form I create a new
instance of ActionErrors and add ActionMessage instances to it.  In the
Action dispatch method I call validate and get a non empty ActionErrors
instance.  To figure how to make this work, I can get the iterator to the
keys and copy it to the request attribute like

Iterator iter = errors.properties ( );
request.setAttribute ( "ERRORS", errors );

but I can't get the messages associated with the property to allow me to
manipulate my page.

What I would like is:

for ActionErrors to be a collection, the I could iterate on the errors and
get the key and the values.  I could iterate on the values, or reteive a
specific one.

I want the ability to inspect an error condition and if it exists or not and
generate jsp accordingly with an error message.

Does anyone know how to do this?

it would look like, but I dream too much

















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



Action Messages

2005-05-27 Thread Ray Madigan
I am looking for the ability to handle the ActionMessage in a different way
in my application.  In the validate method of the form I create a new
instance of ActionErrors and add ActionMessage instances to it.  In the
Action dispatch method I call validate and get a non empty ActionErrors
instance.  To figure how to make this work, I can get the iterator to the
keys and copy it to the request attribute like

Iterator iter = errors.properties ( );
request.setAttribute ( "ERRORS", errors );

but I can't get the messages associated with the property to allow me to
manipulate my page.

What I would like is:

for ActionErrors to be a collection, the I could iterate on the errors and
get the key and the values.  I could iterate on the values, or reteive a
specific one.

I want the ability to inspect an error condition and if it exists or not and
generate jsp accordingly with an error message.

Does anyone know how to do this?

it would look like, but I dream too much














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



Re: Action messages.

2004-06-03 Thread Frank Zammetti
I'm not sure what you mean by "avoid 2 submit 's click".  If your referring 
to the pooling method requiring a submit after the initial one (potential 
any number of submits really), then yes, you would avoid that.

Here's an example off the top of my head (so the disclaimer is it might not 
be perfect!):


Please wait, doing server 
work...


Field A: 
Field B: 





Note the return faksel in the onClick of the submit button... I just did 
this so you'd see it work, without it the form submission proceeds and you 
won't see anything because you immediately get no return.  Or something like 
that anyway :)  The point is, remove that to try this for real against a 
real server.

I think that'll do it, let me know if you need any further help.
Frank
From: "Marcelo Epstein" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: Action messages.
Date: Thu, 3 Jun 2004 13:55:11 -0300
Thanks Frank,
Do you have any sample code of using  ?
I think this is also good to avoid 2 submit´s click. Am I right?

- Original Message -
From: "Frank Zammetti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 03, 2004 11:57 AM
Subject: RE: Action messages.
> You can "fake it" and do this... have a hidden  in your page that,
> just before you submit your form, you display.  You will probably also
want
> to wrap everything else in your page in a  and hide it at the same
> time.  I say this is "faking it" because the browser won't have any idea
> what's going on on the server, which might be OK.
>
> If you want some sort of progress bar though, something that actually 
has
> knowledge of what's going on on the server, what you'll need to do is 
kick
> off a thread in your Action, and store some reference to it persistently
> (i.e., session or a database, etc.).  Then, you'll have to have a page 
on
> the browser with something like a meta-refresh that calls some special
> Action that can check the status of that thread, maybe get some sort of
> percent complete or something like that to display back to the browser.
>
> Obviously, if faking it is good enough, as it usually is in these cases,
> that's by far the better choice.
>
> Frank
>
> >From: "Marcelo Epstein" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: Action messages.
> >Date: Thu, 3 Jun 2004 11:46:44 -0300
> >
> >Hi,
> >
> >I have a Action that takes 10s to execute. Is there any way to display
> >messages in the browser during execution?
> >
> >Thx,
> >Marcelo
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> _
> MSN 9 Dial-up Internet Access fights spam and pop-ups - now 3 months 
FREE!
> http://join.msn.click-url.com/go/onm00200361ave/direct/01/
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Get fast, reliable Internet access with MSN 9 Dial-up – now 3 months FREE! 
http://join.msn.click-url.com/go/onm00200361ave/direct/01/

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


Re: Action messages.

2004-06-03 Thread Marcelo Epstein
Thanks Frank,

Do you have any sample code of using  ?
I think this is also good to avoid 2 submit´s click. Am I right?



- Original Message - 
From: "Frank Zammetti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 03, 2004 11:57 AM
Subject: RE: Action messages.


> You can "fake it" and do this... have a hidden  in your page that,
> just before you submit your form, you display.  You will probably also
want
> to wrap everything else in your page in a  and hide it at the same
> time.  I say this is "faking it" because the browser won't have any idea
> what's going on on the server, which might be OK.
>
> If you want some sort of progress bar though, something that actually has
> knowledge of what's going on on the server, what you'll need to do is kick
> off a thread in your Action, and store some reference to it persistently
> (i.e., session or a database, etc.).  Then, you'll have to have a page on
> the browser with something like a meta-refresh that calls some special
> Action that can check the status of that thread, maybe get some sort of
> percent complete or something like that to display back to the browser.
>
> Obviously, if faking it is good enough, as it usually is in these cases,
> that's by far the better choice.
>
> Frank
>
> >From: "Marcelo Epstein" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: Action messages.
> >Date: Thu, 3 Jun 2004 11:46:44 -0300
> >
> >Hi,
> >
> >I have a Action that takes 10s to execute. Is there any way to display
> >messages in the browser during execution?
> >
> >Thx,
> >Marcelo
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> _
> MSN 9 Dial-up Internet Access fights spam and pop-ups - now 3 months FREE!
> http://join.msn.click-url.com/go/onm00200361ave/direct/01/
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



RE: Action messages.

2004-06-03 Thread Frank Zammetti
You can "fake it" and do this... have a hidden  in your page that, 
just before you submit your form, you display.  You will probably also want 
to wrap everything else in your page in a  and hide it at the same 
time.  I say this is "faking it" because the browser won't have any idea 
what's going on on the server, which might be OK.

If you want some sort of progress bar though, something that actually has 
knowledge of what's going on on the server, what you'll need to do is kick 
off a thread in your Action, and store some reference to it persistently 
(i.e., session or a database, etc.).  Then, you'll have to have a page on 
the browser with something like a meta-refresh that calls some special 
Action that can check the status of that thread, maybe get some sort of 
percent complete or something like that to display back to the browser.

Obviously, if faking it is good enough, as it usually is in these cases, 
that's by far the better choice.

Frank
From: "Marcelo Epstein" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Action messages.
Date: Thu, 3 Jun 2004 11:46:44 -0300
Hi,
I have a Action that takes 10s to execute. Is there any way to display
messages in the browser during execution?
Thx,
Marcelo
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
MSN 9 Dial-up Internet Access fights spam and pop-ups – now 3 months FREE! 
http://join.msn.click-url.com/go/onm00200361ave/direct/01/

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


Action messages.

2004-06-03 Thread Marcelo Epstein
Hi,

I have a Action that takes 10s to execute. Is there any way to display
messages in the browser during execution?

Thx,
Marcelo


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