You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by bOOyah <bo...@nowhere.org> on 2004/04/20 18:51:37 UTC

html:error and quotation marks...

Howdy all

I'm using html:error to put an error message next to a form field that 
must not be blank.  But the message is rendered with quotation marks 
around it.  I don't want quotation marks.  Am I doing something I 
shouldn't, or is there any way to turn this behavior off?

My JSP looks like this:

<thead>
   <th><html:text name="myName" property="name" size="40"/></th>
   <th><html:errors property="myName" /></th>
</thead>


The resulting HTML looks like this:

<thead>
   <th><input type="text" name="name" size="40" value=""></th>
   <th>"The 'Name' field is required"</th>
</thead>


My Form.validate()
==================
ActionErrors errors = new ActionErrors();
if (getMyName() == null || getMyName().length < 1) {
     errors.add("myName", new ActionError("err.name.required", "Name");
}
return errors;


My Application.Properties file
==============================
err.name.required=The '{0}' field is required


Thanks
-- 
bOOyah


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


Re: html:error and quotation marks...

Posted by bOOyah <bo...@nowhere.org>.
Henrique VIECILI wrote:

> have you tried changing your ApplicationResources to
> err.name.required=The {0} field is required (whitout the quotes') ?

Sorry Henrique...it was my own stupidity all along.  My app was using an 
old Application.properties file that had my message enclosed in 
quotation marks, but I was editing a new one by mistake.  DOH!

Thanks anyway.  And those single quote marks don't cause any problems. 
They work as expected so I left them in.

-- 
bOOyah


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


Re: html:error and quotation marks...

Posted by bOOyah <bo...@nowhere.org>.
Henrique VIECILI wrote:

> have you tried changing your ApplicationResources to
> err.name.required=The {0} field is required (whitout the quotes') ?

Sorry Henrique...it was my own stupidity all along.  My app was using an 
old Application.properties file that had my message enclosed in 
quotation marks, but I was editing a new one by mistake.  DOH!

Thanks anyway.  And those single quote marks don't cause any problems. 
They work as expected so I left them in.

-- 
bOOyah

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


Re: html:error and quotation marks...

Posted by Henrique VIECILI <vi...@softplan.com.br>.
have you tried changing your ApplicationResources to
err.name.required=The {0} field is required (whitout the quotes') ?

it should work.

[]´s Henrique Viecili

----- Original Message ----- 
From: "bOOyah" <bo...@nowhere.org>
To: <us...@struts.apache.org>
Sent: Tuesday, April 20, 2004 1:51 PM
Subject: html:error and quotation marks...


> Howdy all
>
> I'm using html:error to put an error message next to a form field that
> must not be blank.  But the message is rendered with quotation marks
> around it.  I don't want quotation marks.  Am I doing something I
> shouldn't, or is there any way to turn this behavior off?
>
> My JSP looks like this:
>
> <thead>
>    <th><html:text name="myName" property="name" size="40"/></th>
>    <th><html:errors property="myName" /></th>
> </thead>
>
>
> The resulting HTML looks like this:
>
> <thead>
>    <th><input type="text" name="name" size="40" value=""></th>
>    <th>"The 'Name' field is required"</th>
> </thead>
>
>
> My Form.validate()
> ==================
> ActionErrors errors = new ActionErrors();
> if (getMyName() == null || getMyName().length < 1) {
>      errors.add("myName", new ActionError("err.name.required", "Name");
> }
> return errors;
>
>
> My Application.Properties file
> ==============================
> err.name.required=The '{0}' field is required
>
>
> Thanks
> -- 
> bOOyah
>
>
> ---------------------------------------------------------------------
> 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