You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dionisius Purba <Di...@mitrais.com> on 2004/08/19 03:43:53 UTC
how to make validator read non-standard bundle
Hi everyone,
can someone confirm whether in struts's validator
(which if i'm not mistaken, rely on commons-validator),
we can or we can not
use non-standard bundle (i.e ApplicationResources.properties)?
If not, what's the usual workaround that you do?
I've tried using Struts 1.2, downloaded from
http://www.apache.org/~martinc/struts/v1.2.0/
and modify the "struts-example" web-apps in validation.xml
so the "username" property will be from "alternate" bundle
where that "alternate" bundle is already defined in
struts-config.xml
as follow:
<message-resources
parameter="org.apache.struts.webapp.example.AlternateApplicationResources"
key="alternate">
</message-resources>
validation.xml
<form name="RegistrationForm">
<field property="replyToAddress"
depends="email">
<arg0 key="prompt.replyToAddress"/>
</field>
<field property="username"
depends="required">
<arg bundle="alternate" key="prompt.username" position="0"/>
</field>
</form>
Lots of thanks for any suggestion/helps.
~dion
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org