You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by 梁炳場 <pc...@gmail.com> on 2005/08/25 06:22:11 UTC
Validator Questions?
Struts 1.2.7
(1)
The following tag can test the emptiness of the field.
<html:errors property="username" header="empty"/>
If I want to display a specific message when it is not empty
and display error message when it is empty,
what should be done in header="???" or something else
(2)
I have a message in MessageResources.properties like
addUserProfileForm.username.label
but do not have addUserProfileForm.username
It gives an error message like this.
???zh_TW.addUserProfileForm.username??? is required.
Can it be done as using addUserProfileForm.username.label
instead of addUserProfileForm.username
when the field is empty?
Thank you very much
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Validator Questions?
Posted by 梁炳場 <pc...@gmail.com>.
(1) Could I add extra message to <html:errors property="username"
header="empty"/> in addition to empty message?
Does <html:errors> only capture ActionErrors, not ActionMessages?
(2) I have fixed it by modifying validation.xml.
Thank
2005/8/25, 梁炳場 <pc...@gmail.com>:
> Struts 1.2.7
>
> (1)
> The following tag can test the emptiness of the field.
> <html:errors property="username" header="empty"/>
>
> If I want to display a specific message when it is not empty
> and display error message when it is empty,
> what should be done in header="???" or something else
>
>
> (2)
> I have a message in MessageResources.properties like
> addUserProfileForm.username.label
> but do not have addUserProfileForm.username
>
> It gives an error message like this.
> ???zh_TW.addUserProfileForm.username??? is required.
>
> Can it be done as using addUserProfileForm.username.label
> instead of addUserProfileForm.username
> when the field is empty?
>
> Thank you very much
>