You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dominique de Waleffe <dd...@missioncriticalit.com> on 2003/11/18 13:29:41 UTC

ActionErrors problem...

I have this in my code:
    errors.add(ActionErrors.GLOBAL_ERROR,
           new 
ActionError("error.key.invalid-value.dummy","<keyname>","<value>","<expected>");

I have this in application.properties:
error.key.invalid-value.dummy=DUMMY: key:{0} Value:{1} expected:{2}

However,  using <html:errors/> in my page, the only thing that gets 
displayed is:
DUMMY: key: Value: expected:

i.e. the replacement values I give are swallowed.

Any idea on what I am doing wrong? I tried calling new ActionError(..,a) 
where a is an Object[] with the values I want. This did not work either.

I imagine I must be missing something obvious...

Thanks for any hint...
D.

-- 
Dominique de Waleffe   Email: ddw@missioncriticalit.com [No HTML please]
Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium  
Phone: +32 2 757 10 15  Fax: +32 2 759 27 60



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


Re: ActionErrors problem...

Posted by Dominique de Waleffe <dd...@missioncriticalit.com>.
Caroline Lauferon wrote:

>I've just made a little test writing DUMMY: key:<keyname> Value:<value>
>expected:<expected> in an html document...... and i got DUMMY: key: Value:
>expected: ....
>the problem is that < is a special html symbol.... explorer thinks its an
>unknown tag and outputs nothing.
>if you look in the HTML source of your document, i think you'll see what you
>were expecting.
>to output < , use &lt;
>  
>
Of course. Completely missed that one... I was really looking for 
something else..l
Thanks a lot,
D.

-- 
Dominique de Waleffe   Email: ddw@missioncriticalit.com [No HTML please]
Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium  
Phone: +32 2 757 10 15  Fax: +32 2 759 27 60



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


Re: ActionErrors problem...

Posted by Caroline Lauferon <ca...@cgey.com>.
I've just made a little test writing DUMMY: key:<keyname> Value:<value>
expected:<expected> in an html document...... and i got DUMMY: key: Value:
expected: ....
the problem is that < is a special html symbol.... explorer thinks its an
unknown tag and outputs nothing.
if you look in the HTML source of your document, i think you'll see what you
were expecting.
to output < , use &lt;

hope it helps

Caroline

----------------------------------------------------------------------------
----
Caroline LAUFERON
 Cap Gemini Telecom Media & Networks France
 Skill Center VASN - RENNES

02 99 27 61 92
caroline.lauferon@cgey.com
----------------------------------------------------------------------------
----


----- Original Message -----
From: "Dominique de Waleffe" <dd...@missioncriticalit.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, November 18, 2003 1:29 PM
Subject: ActionErrors problem...


I have this in my code:
    errors.add(ActionErrors.GLOBAL_ERROR,
           new
ActionError("error.key.invalid-value.dummy","<keyname>","<value>","<expected
>");

I have this in application.properties:
error.key.invalid-value.dummy=DUMMY: key:{0} Value:{1} expected:{2}

However,  using <html:errors/> in my page, the only thing that gets
displayed is:
DUMMY: key: Value: expected:

i.e. the replacement values I give are swallowed.

Any idea on what I am doing wrong? I tried calling new ActionError(..,a)
where a is an Object[] with the values I want. This did not work either.

I imagine I must be missing something obvious...

Thanks for any hint...
D.

--
Dominique de Waleffe   Email: ddw@missioncriticalit.com [No HTML please]
Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium
Phone: +32 2 757 10 15  Fax: +32 2 759 27 60



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


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


Re: ActionErrors problem...

Posted by Dominique de Waleffe <dd...@missioncriticalit.com>.
Brad Balmer wrote:

> This may be a copy/paste issue, but this shouldn't even compile as it 
> looks here.  You are missing a ) at the end.

Cut-n-paste error. The code compiles. Only the replacements do not appear.
When I put an extra placeholder {3} and give 3 args only, the {3} 
appears in the message. The {0} to {2} are swallowed...

D.
-- 

Dominique de Waleffe   Email: ddw@missioncriticalit.com [No HTML please]
Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium  
Phone: +32 2 757 10 15  Fax: +32 2 759 27 60



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


Re: ActionErrors problem...

Posted by Brad Balmer <bb...@peapod.com>.
This may be a copy/paste issue, but this shouldn't even compile as it 
looks here.  You are missing a ) at the end.


Dominique de Waleffe wrote:

> I have this in my code:
>    errors.add(ActionErrors.GLOBAL_ERROR,
>           new 
> ActionError("error.key.invalid-value.dummy","<keyname>","<value>","<expected>"); 
>
>
> I have this in application.properties:
> error.key.invalid-value.dummy=DUMMY: key:{0} Value:{1} expected:{2}
>
> However,  using <html:errors/> in my page, the only thing that gets 
> displayed is:
> DUMMY: key: Value: expected:
>
> i.e. the replacement values I give are swallowed.
>
> Any idea on what I am doing wrong? I tried calling new 
> ActionError(..,a) where a is an Object[] with the values I want. This 
> did not work either.
>
> I imagine I must be missing something obvious...
>
> Thanks for any hint...
> D.
>



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


Re: ActionErrors problem...

Posted by Dominique de Waleffe <dd...@missioncriticalit.com>.
Susan Bradeen wrote:

>On 11/18/2003 07:29:41 AM Dominique de Waleffe wrote:
>
>  
>
>>I have this in my code:
>>errors.add(ActionErrors.GLOBAL_ERROR,
>>new
>>
>>    
>>
>ActionError("error.key.invalid-value.dummy","<keyname>","<value>","<expected>");
>
>Are <keyname>, <value>, <expected> evaluated or literal values? Do you mean
>to have the quotes around them? Can you print out the values in statements
>to make sure they are not blank values?
>
>  
>
They are just String values I  want to be included in my message...
This was just a test to see if the thing works, I expect:

DUMMY: key:<keyname> Value:<value> expected:<expected>

Of course in the rest of the code I have other strings to put....
D.

-- 
Dominique de Waleffe   Email: ddw@missioncriticalit.com [No HTML please]
Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium  
Phone: +32 2 757 10 15  Fax: +32 2 759 27 60



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


Re: ActionErrors problem...

Posted by Susan Bradeen <Su...@softlanding.com>.
On 11/18/2003 07:29:41 AM Dominique de Waleffe wrote:

> I have this in my code:
> errors.add(ActionErrors.GLOBAL_ERROR,
> new
>
ActionError("error.key.invalid-value.dummy","<keyname>","<value>","<expected>");

>

Are <keyname>, <value>, <expected> evaluated or literal values? Do you mean
to have the quotes around them? Can you print out the values in statements
to make sure they are not blank values?

Susan

> I have this in application.properties:
> error.key.invalid-value.dummy=DUMMY: key:{0} Value:{1} expected:{2}
>
> However,  using <html:errors/> in my page, the only thing that gets
> displayed is:
> DUMMY: key: Value: expected:
>
> i.e. the replacement values I give are swallowed.
>
> Any idea on what I am doing wrong? I tried calling new ActionError(..,a)
> where a is an Object[] with the values I want. This did not work either.
>
> I imagine I must be missing something obvious...
>
> Thanks for any hint...
> D.
>
> --
> Dominique de Waleffe   Email: ddw@missioncriticalit.com [No HTML please]
> Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium
> Phone: +32 2 757 10 15  Fax: +32 2 759 27 60
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>



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