You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Wendy Smoak <ws...@gmail.com> on 2005/11/13 04:04:12 UTC

Validator Plugin and validator-rules.xml

How many people modify validator-rules.xml vs. adding custom rules to
validation.xml (or an additional file)?

While working on the "Struts Blank" archetype for Maven 2, it became
apparent that we have an un-Maven-like situation with
validator-rules.xml.  It lives in core and has to be copied across
modules in order for apps to build properly.  That means you can't
check out apps separately and build it, the build doesn't work unless
you have at least core and apps checked out and structured so the
relative paths work.

The solution is to include validator-rules.xml in struts-core.jar.

Then you can *optionally* use it when you configure the Validator Plugin:
  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
      <set-property property="pathnames"
                         
value="/org/apache/struts/validator/validator-rules.xml,
                                    /WEB-INF/validation.xml" />
  </plug-in>
Or you can extract it from the jar (or continue using your existing
version of it) and configure the plugin "as usual" with
"/WEB-INF/validator-rules.xml".

However, I think using the copy inside struts-core.jar should be the
recommended configuration and would like to change the example apps to
reflect that.

Thoughts?

--
Wendy

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


Re: Validator Plugin and validator-rules.xml

Posted by Laurie Harper <la...@holoweb.net>.
Wendy Smoak wrote:
> How many people modify validator-rules.xml vs. adding custom rules to
> validation.xml (or an additional file)?
> 
> While working on the "Struts Blank" archetype for Maven 2, it became
> apparent that we have an un-Maven-like situation with
> validator-rules.xml.  It lives in core and has to be copied across
> modules in order for apps to build properly.  That means you can't
> check out apps separately and build it, the build doesn't work unless
> you have at least core and apps checked out and structured so the
> relative paths work.
> 
> The solution is to include validator-rules.xml in struts-core.jar.
> 
> Then you can *optionally* use it when you configure the Validator Plugin:
>   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
>       <set-property property="pathnames"
>                          
> value="/org/apache/struts/validator/validator-rules.xml,
>                                     /WEB-INF/validation.xml" />
>   </plug-in>
> Or you can extract it from the jar (or continue using your existing
> version of it) and configure the plugin "as usual" with
> "/WEB-INF/validator-rules.xml".
> 
> However, I think using the copy inside struts-core.jar should be the
> recommended configuration and would like to change the example apps to
> reflect that.
> 
> Thoughts?

+1

Sounds good to me, it'd remove one more gotcha when upgrading to a new 
Struts release.

L.


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