You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Van Riper, Mike" <mv...@verisign.com> on 2002/12/16 21:18:10 UTC

RE: FW: Validation DTD bug? (impacts my use of Struts Console)

James,

I never received any feedback, but, they did address this problem in the
just announced release of the 1.0.1 version of the Commons Validator. The
DTD in this version has the following DOCTYPE specification:

   <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.0//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">

And the ELEMENT definition in the DTD for field elements has been changed to
this:

   <!ELEMENT field   (msg|arg0|arg1|arg2|arg3|var)*>

Until a future release of your tool that supports this new version of the
Commons Validator, I can continue to hand edit my validation.xml files
directly. My main concern was that the DTD allow for the necessary field
validation definitions going forward and this has been dealt with. So, I'm a
happy camper now. It would have been nice for someone to let me know they
were taking care of it when I asked though. Oh well.

Cheers,
  Mike Van Riper
  mvanriper@verisign.com

> -----Original Message-----
> From: James Holmes [mailto:jholmes612@yahoo.com]
> Sent: Thursday, December 12, 2002 12:48 PM
> To: Van Riper, Mike
> Subject: RE: FW: Validation DTD bug? (impacts my use of 
> Struts Console)
> 
> 
> Actually, I think this message is best targeted at the
> Commons Validator lists.  I think you're right about
> the DTD, but haven't fully looked into it.  If you get
> feedback from the Commons lists let me know.
> 
> -james
> 
> 
> --- "Van Riper, Mike" <mv...@verisign.com> wrote:
> > 
> > > -----Original Message-----
> > > I'm guessing your Validator config file issue is
> > > similar.
> > 
> > I don't think it is. The DOCTYPE in that case was
> > already using the 1.1
> > versioning like so:
> > 
> >   <!DOCTYPE form-validation PUBLIC
> >        "-//Apache Software Foundation//DTD
> > Validation Configuration 1.1//EN"
> >       
> >
> "http://jakarta.apache.org/struts/dtds/validation_1_1.dtd">
> > 
> > I believe this has more to do with the original
> > issue I posted on the
> > struts-user list. My validation.xml file doesn't
> > validate successfully
> > against this DTD requirement:
> > 
> >   <!ELEMENT field  (msg?, arg0?, arg1?, arg2?,
> > arg3?, var* )>
> > 
> > because when you use both the minlength and
> > maxlength validations on a
> > single field, you end up with more than one <arg1>
> > element inside the field
> > element definition like so:
> > 
> >       <field property="zip"
> > depends="minlength,maxlength">
> >         <arg0 key="prompt.zip"/>
> >         <arg1 name="minlength"
> > key="${var:minlength}" resource="false"/>
> >         <arg1 name="maxlength"
> > key="${var:maxlength}" resource="false"/>
> >         <var>
> >           <var-name>minlength</var-name>
> >           <var-value>5</var-value>
> >         </var>
> >         <var>
> >           <var-name>maxlength</var-name>
> >           <var-value>10</var-value>
> >         </var>
> >       </field>
> > 
> > Unless the <arg1> is defined separately for
> > minlength and maxlength
> > validations, it is not possible to generate the
> > correct validation error
> > message with the appropriate minlength or maxlength
> > value inserted in the
> > error message. This is why I suggested that the DTD
> > needed to change like
> > so:
> > 
> >   <!ELEMENT field  (msg?, arg0*, arg1*, arg2*,
> > arg3*, var* )>
> > 
> > This way, you are allowed to specify different
> > <argx> values for
> > substitution in the error message when different
> > validation rules are
> > violated. I realize this is a validation DTD issue
> > and not a Struts Console
> > issue. However, it is preventing me from using the
> > Struts Console in the
> > recommended fashion with validation turned on and I
> > do believe this is a
> > validator DTD bug.
> > 
> > I've already changed my local copy of the DTD so I
> > can validate against it
> > in my IDE, IntelliJ. However, this doesn't help me
> > when I try to use the
> > Struts Console on my validation.xml file. I'm
> > surprised that I didn't get a
> > single response when I posted this on the
> > struts-user list before. Should I
> > have posted this on the struts-dev list instead?
> > 
> > - Mike Van Riper
> >   mvanriper@verisign.com
> > 
> > P.S. James, Thanks again for your help correcting my
> > DOCTYPE specification
> > for tile definitions. I am able to edit tile
> > definitions now using your tool
> > without leaving the comfort of my Java IDE. :-)
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>