struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Christopher <tim.christop...@gmail.com>
Subject Re: problem with Application
Date Tue, 22 Feb 2005 02:43:06 GMT
The "???enUS.errors.required???" means that it's looking for an entry
in your properties file for errors.required but is unable to find one.

What you need to do is add something like:

#-- validation errors
errors.required={0} is required

#--diplay names
prompt.password = Password
prompt.userName = Username

/////////////////////////////////////
This means that for the following example:

<field property="password" depends="required">
      <arg0   key="prompt.password"/>
</field>

If an error is triggered by the "required"  validation, it will
automatically call "errors.required" in your properties file.  The {0}
in the definition of "errors.required" means that it should replace
{0} with the value of the key for arg0.  In this case the value for
this key is "Password".  Thus the final error message you will see is
"Password is required".

Hope that solves your problem.

Tim Christopher

On Mon, 21 Feb 2005 16:39:43 -0800, jonathan zhang <lordofring@gmail.com> wrote:
> I defined a file ApplicationResources.properties under
> com.xxx.software.xxx.resources, which contains the following lines:
> prompt.password = "The password you entered does not satisfy the basic
> requirement"
> prompt.userName = "You must enter a user name"
> 
> in my struts-config i have
> <message-resources
> parameter="com.titan.software.hsm.resources.ApplicationResources"
> null="false"/>
> 
> in my validation.xml I have
> <form-validation>
>        <formset>
> 
>                <form name="logonForm">
>                        <field property="userName" depends="required">
>                        <arg0   key="prompt.userName"/>
>                        </field>
> 
>             <field property="password"
>                    depends="required">
>                <arg0   key="prompt.password"/>
> 
>            </field>
>                </form>
> 
>   </formset>
> </form-validation>
> 
> upon struts validation the javascript says
> "???en_US.errors.required???"
> "???en_US.errors.required???"
> which refers to the userName and password, does this mean the
> validator are not getting prompt.userName and prompt.password ?
> what am I doing wrong? i have been going the steps a couple of times
> and can't find a loophole .  help me out here...
> thanks
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message