You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Seekamp <cr...@bellsouth.net> on 2002/05/17 16:39:50 UTC
Freeze config after plugins init runs?
The configuration is frozen as soon as the struts-config.xml is
processed. Since I think plugins are intended to allow you to extend
Struts, I was wondering if it wouldn't make sense to wait to freeze the
configuration until after the plugins initialization step had run. This
would allow the plugins, during initialization, to add to the
configuration. This way, without having to modify the Struts DTD, you
could have a plugin use some separate configuration information in a
separate configuration file and update the Struts configuration.
It seems reasonable to me, but I may well be missing something, so I
thought I would ask. Right now I am having to keep a separate pool of
my own ActionMappings and look them up myself to handle this.
Thanks.
Chris Seekamp
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: complex validation with Validator
Posted by Michael Marrotte <ma...@nicusa.com>.
For credit card, I put this in my validator-rules.xml:
<validator
name="creditCard"
classname="org.apache.struts.util.StrutsValidator"
method="validateCreditCard"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends="required"
msg="errors.creditcard">
</validator>
And this in my validation.xml
<form name="myForm">
<field property="creditCardName" depends="required">
<arg0 key="prompt.creditCardName"/>
</field>
</form>
There's other examples (e.g. required) in the nightly struts-example
validat***.xml files. Depending on the digits your validating, you might
want to look into defining it as a <constant> regular expression in your
validation.xml file.
--Michael Marrotte
-----Original Message-----
From: Emerson Cargnin - MSA [mailto:emersonc@sicredi.com.br]
Sent: Friday, May 17, 2002 8:41 AM
To: Struts Users Mailing List
Subject: complex validation with Validator
I know that with struts Validator I can do validation in client and server
with just one specification. May I use complex validation like credit number
calculation? or validation digit account?
Thanks
Emerson
----- Original Message -----
From: "Chris Seekamp" <cr...@bellsouth.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, May 17, 2002 11:39 AM
Subject: Freeze config after plugins init runs?
> The configuration is frozen as soon as the struts-config.xml is
> processed. Since I think plugins are intended to allow you to extend
> Struts, I was wondering if it wouldn't make sense to wait to freeze the
> configuration until after the plugins initialization step had run. This
> would allow the plugins, during initialization, to add to the
> configuration. This way, without having to modify the Struts DTD, you
> could have a plugin use some separate configuration information in a
> separate configuration file and update the Struts configuration.
>
> It seems reasonable to me, but I may well be missing something, so I
> thought I would ask. Right now I am having to keep a separate pool of
> my own ActionMappings and look them up myself to handle this.
>
> Thanks.
>
> Chris Seekamp
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
complex validation with Validator
Posted by Emerson Cargnin - MSA <em...@sicredi.com.br>.
I know that with struts Validator I can do validation in client and server
with just one specification. May I use complex validation like credit number
calculation? or validation digit account?
Thanks
Emerson
----- Original Message -----
From: "Chris Seekamp" <cr...@bellsouth.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, May 17, 2002 11:39 AM
Subject: Freeze config after plugins init runs?
> The configuration is frozen as soon as the struts-config.xml is
> processed. Since I think plugins are intended to allow you to extend
> Struts, I was wondering if it wouldn't make sense to wait to freeze the
> configuration until after the plugins initialization step had run. This
> would allow the plugins, during initialization, to add to the
> configuration. This way, without having to modify the Struts DTD, you
> could have a plugin use some separate configuration information in a
> separate configuration file and update the Struts configuration.
>
> It seems reasonable to me, but I may well be missing something, so I
> thought I would ask. Right now I am having to keep a separate pool of
> my own ActionMappings and look them up myself to handle this.
>
> Thanks.
>
> Chris Seekamp
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>