You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryan Hunt <ad...@revoltingdigits.com> on 2004/07/13 20:12:52 UTC

validation wierdness possibly related to multiple struts config files

I have the following jsp page
snip=
<html:errors/>
  <table width="712" border="0">
    <tr>
      <td width="197">
        <html:form action="/client-change-password-action">
          <table>
            <tr>
              <th align="right"><bean:message 
key="label.oldPassword"/>:</th>
              <td>
                <html:text property="oldPassword"/>
              </td>
etc etc etc
=snip

I have 4 struts config files default.xml,client.xml,admin.xml,sales.xml

They are declared as so in my web.xml file.
snip=
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts/default.xml,
/WEB-INF/struts/client.xml,
/WEB-INF/struts/sales.xml,
/WEB-INF/struts/admin.xml
</param-value>
</init-param>
=snip

The default.xml contains the following lines which work just fine for 
everything else
snip=
 <message-resources parameter="ie.jestate.web.ApplicationResources"/>

<!-- Plug Ins Configuration -->

  <plug-in className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="definitions-config" 
value="/WEB-INF/tiles/default-defs.xml,/WEB-INF/tiles/client-defs.xml,/WEB-INF/tiles/sales-defs.xml,/WEB-INF/tiles/admin-defs.xml" 
/>
    <set-property property="moduleAware" value="true" />
    <set-property property="definitions-parser-validate" value="true" />
  </plug-in>

   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" 
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
  </plug-in>
=snip

My validation.xml file has the following relevant lines ...
snip=
  <form name="ClientChangePasswordForm">
            <field property="oldPassword" depends="required">
            <arg0 key="label.oldPassword"/>
            </field>
            <field property="newPassword" depends="required">
            <arg0 key="label.newPassword"/>
            </field>
            <field property="confirmNewPassword" depends="required">
            <arg0 key="label.confirmNewPassword" />
            </field>
        </form>
=snip

My ApplicationResources.properties file has the following content
snip=
label.oldPassword=Old Password
label.newPassword=New Password
label.confirmNewPassword=Confirm New Password
errors.required={0} is required.<br>
errors.minlength={0} cannot be less than {1} characters.<br>

=snip
Now everything works fine including the labels (ie <bean:message 
key="label.oldPassword"/> ) but when
the form is submitted but not all the fields are filled out I get the 
following messages ( output from <html:errors/>.

null is required.
null is required.
null is required.

Is this possibly a Struts bug or is it too late in the day and I drink 
to many units at the weekend being an Irishman ?

--b

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


Re: validation wierdness possibly related to multiple struts config files

Posted by Bill Siggelkow <bi...@bellsouth.net>.
I am using this DTD declaration in my validation.xml and 
validator-rules.xml files:

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

It lets me access the new <arg> element.

Bill

Bryan Hunt wrote:

> finally solved it.
> 
> When you have the following DTD definition in your validation.xml file
> snip=
> <!DOCTYPE form-validation PUBLIC
>          "-//Apache Software Foundation//DTD Commons Validator Rules
> Configuration 1.0//EN"
>          "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
> =snip
> It breaks.
> 
> When you have the following DTD definition in your validation.xml file *
> *snip=
> <!DOCTYPE form-validation SYSTEM
> "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">
> =snip*
> *It works
> 
> When you have the following DTD definition in your validation.xml file
> snip=
> <!DOCTYPE form-validation SYSTEM
> "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
> =snip
> It works.
> 
> 
> --b
> 
> Bryan Hunt wrote:
> 
>> Ok , dunno who to report this to but this validator stuff needs to be 
>> looked at before this
>> is released to the public cause it's a bit of a mess.
>>
>> Just noticed that the version of validator-rules that is distributed 
>> is for the validator_1_1.dtd version.
>>
>> I think somebody needs to take a little look at this. It doesn't seem 
>> to know whether to do
>> 1.1 or 1.2 stuff. Some of the behaviour is from one and some from the 
>> other.
>>
>> --b
>>
>> Bryan Hunt wrote:
>>
>>> Thank you Bill, your answer was correct. I've found that 
>>> commons-validator as distibuted with the latest
>>> 1.2.1 version of struts doesn't include the 
>>> http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
>>> file. So despite my specifying the DTD like so
>>> snip=
>>>
>>> <!DOCTYPE form-validation PUBLIC
>>>          "-//Apache Software Foundation//DTD Commons Validator Rules 
>>> Configuration 1.0//EN"
>>>          "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
>>> =snip
>>>
>>> I've copied the following files over to my libs dir.
>>>
>>> snip=
>>> 08/07/2004  09:26              358,273 antlr.jar
>>> 08/07/2004  09:26              118,726 commons-beanutils.jar
>>> 08/07/2004  09:26              165,119 commons-collections.jar
>>> 08/07/2004  09:26              109,096 commons-digester.jar
>>> 08/07/2004  09:26               22,379 commons-fileupload.jar
>>> 08/07/2004  09:26               38,015 commons-logging.jar
>>> 08/07/2004  09:26               84,260 commons-validator.jar
>>> 08/07/2004  09:26               65,425 jakarta-oro.jar
>>> 08/07/2004  09:26              520,842 struts.jar
>>> =snip
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>


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


Re: validation wierdness possibly related to multiple struts config files

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Its in the commons-validator.jar that I downloaded with Struts 1.2.1

Fair enough if it works - still the wrong one though.

Niall

----- Original Message ----- 
From: "Bryan Hunt" <ad...@revoltingdigits.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, July 15, 2004 3:14 PM
Subject: Re: validation wierdness possibly related to multiple struts config
files


> hmmmm ... if i put that in mine I get a file not found exception.... the
> commons-validator jar doesn't include that one.
> with this definition it seems to be working ok for the time being
>
> <!DOCTYPE form-validation SYSTEM
> "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
>
> curse these dtd's :-)
>
> --b
>
>
>
>
>
> Niall Pemberton wrote:
>
> >I got confused recently about validator versions  - validator 1.1.3 has
just
> >been released and thats what Struts 1.2.1 uses - validator 1.2 is still
in
> >development so you need to be using
> >
> > <!DOCTYPE form-validation PUBLIC
> >           "-//Apache Software Foundation//DTD Commons Validator Rules
> > Configuration 1.0//EN"
> >           "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
> >
> >
> >Niall
> >
> >----- Original Message ----- 
> >From: "Bryan Hunt" <ad...@revoltingdigits.com>
> >To: "Struts Users Mailing List" <us...@struts.apache.org>
> >Sent: Thursday, July 15, 2004 2:20 PM
> >Subject: Re: validation wierdness possibly related to multiple struts
config
> >files
> >
> >
> >
> >
> >>finally solved it.
> >>
> >>When you have the following DTD definition in your validation.xml file
> >>snip=
> >><!DOCTYPE form-validation PUBLIC
> >>          "-//Apache Software Foundation//DTD Commons Validator Rules
> >>Configuration 1.0//EN"
> >>          "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
> >>=snip
> >>It breaks.
> >>
> >>When you have the following DTD definition in your validation.xml file *
> >>*snip=
> >><!DOCTYPE form-validation SYSTEM
> >>"http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">
> >>=snip*
> >>*It works
> >>
> >>When you have the following DTD definition in your validation.xml file
> >>snip=
> >><!DOCTYPE form-validation SYSTEM
> >>"http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
> >>=snip
> >>It works.
> >>
> >>
> >>--b
> >>
> >>Bryan Hunt wrote:
> >>
> >>
> >>
> >>>Ok , dunno who to report this to but this validator stuff needs to be
> >>>looked at before this
> >>>is released to the public cause it's a bit of a mess.
> >>>
> >>>Just noticed that the version of validator-rules that is distributed
> >>>is for the validator_1_1.dtd version.
> >>>
> >>>I think somebody needs to take a little look at this. It doesn't seem
> >>>to know whether to do
> >>>1.1 or 1.2 stuff. Some of the behaviour is from one and some from the
> >>>other.
> >>>
> >>>--b
> >>>
> >>>Bryan Hunt wrote:
> >>>
> >>>
> >>>
> >>>>Thank you Bill, your answer was correct. I've found that
> >>>>commons-validator as distibuted with the latest
> >>>>1.2.1 version of struts doesn't include the
> >>>>http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
> >>>>file. So despite my specifying the DTD like so
> >>>>snip=
> >>>>
> >>>><!DOCTYPE form-validation PUBLIC
> >>>>         "-//Apache Software Foundation//DTD Commons Validator Rules
> >>>>Configuration 1.0//EN"
> >>>>         "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
> >>>>=snip
> >>>>
> >>>>I've copied the following files over to my libs dir.
> >>>>
> >>>>snip=
> >>>>08/07/2004  09:26              358,273 antlr.jar
> >>>>08/07/2004  09:26              118,726 commons-beanutils.jar
> >>>>08/07/2004  09:26              165,119 commons-collections.jar
> >>>>08/07/2004  09:26              109,096 commons-digester.jar
> >>>>08/07/2004  09:26               22,379 commons-fileupload.jar
> >>>>08/07/2004  09:26               38,015 commons-logging.jar
> >>>>08/07/2004  09:26               84,260 commons-validator.jar
> >>>>08/07/2004  09:26               65,425 jakarta-oro.jar
> >>>>08/07/2004  09:26              520,842 struts.jar
> >>>>=snip
> >>>>
> >>>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>For additional commands, e-mail: user-help@struts.apache.org
> >>>
> >>>
> >>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



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


Re: validation wierdness possibly related to multiple struts config files

Posted by Bryan Hunt <ad...@revoltingdigits.com>.
hmmmm ... if i put that in mine I get a file not found exception.... the 
commons-validator jar doesn't include that one.
with this definition it seems to be working ok for the time being

<!DOCTYPE form-validation SYSTEM
"http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">

curse these dtd's :-) 

--b





Niall Pemberton wrote:

>I got confused recently about validator versions  - validator 1.1.3 has just
>been released and thats what Struts 1.2.1 uses - validator 1.2 is still in
>development so you need to be using
>
> <!DOCTYPE form-validation PUBLIC
>           "-//Apache Software Foundation//DTD Commons Validator Rules
> Configuration 1.0//EN"
>           "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
>
>
>Niall
>
>----- Original Message ----- 
>From: "Bryan Hunt" <ad...@revoltingdigits.com>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Sent: Thursday, July 15, 2004 2:20 PM
>Subject: Re: validation wierdness possibly related to multiple struts config
>files
>
>
>  
>
>>finally solved it.
>>
>>When you have the following DTD definition in your validation.xml file
>>snip=
>><!DOCTYPE form-validation PUBLIC
>>          "-//Apache Software Foundation//DTD Commons Validator Rules
>>Configuration 1.0//EN"
>>          "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
>>=snip
>>It breaks.
>>
>>When you have the following DTD definition in your validation.xml file *
>>*snip=
>><!DOCTYPE form-validation SYSTEM
>>"http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">
>>=snip*
>>*It works
>>
>>When you have the following DTD definition in your validation.xml file
>>snip=
>><!DOCTYPE form-validation SYSTEM
>>"http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
>>=snip
>>It works.
>>
>>
>>--b
>>
>>Bryan Hunt wrote:
>>
>>    
>>
>>>Ok , dunno who to report this to but this validator stuff needs to be
>>>looked at before this
>>>is released to the public cause it's a bit of a mess.
>>>
>>>Just noticed that the version of validator-rules that is distributed
>>>is for the validator_1_1.dtd version.
>>>
>>>I think somebody needs to take a little look at this. It doesn't seem
>>>to know whether to do
>>>1.1 or 1.2 stuff. Some of the behaviour is from one and some from the
>>>other.
>>>
>>>--b
>>>
>>>Bryan Hunt wrote:
>>>
>>>      
>>>
>>>>Thank you Bill, your answer was correct. I've found that
>>>>commons-validator as distibuted with the latest
>>>>1.2.1 version of struts doesn't include the
>>>>http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
>>>>file. So despite my specifying the DTD like so
>>>>snip=
>>>>
>>>><!DOCTYPE form-validation PUBLIC
>>>>         "-//Apache Software Foundation//DTD Commons Validator Rules
>>>>Configuration 1.0//EN"
>>>>         "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
>>>>=snip
>>>>
>>>>I've copied the following files over to my libs dir.
>>>>
>>>>snip=
>>>>08/07/2004  09:26              358,273 antlr.jar
>>>>08/07/2004  09:26              118,726 commons-beanutils.jar
>>>>08/07/2004  09:26              165,119 commons-collections.jar
>>>>08/07/2004  09:26              109,096 commons-digester.jar
>>>>08/07/2004  09:26               22,379 commons-fileupload.jar
>>>>08/07/2004  09:26               38,015 commons-logging.jar
>>>>08/07/2004  09:26               84,260 commons-validator.jar
>>>>08/07/2004  09:26               65,425 jakarta-oro.jar
>>>>08/07/2004  09:26              520,842 struts.jar
>>>>=snip
>>>>        
>>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>  
>

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


Re: validation wierdness possibly related to multiple struts config files

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
I got confused recently about validator versions  - validator 1.1.3 has just
been released and thats what Struts 1.2.1 uses - validator 1.2 is still in
development so you need to be using

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


Niall

----- Original Message ----- 
From: "Bryan Hunt" <ad...@revoltingdigits.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, July 15, 2004 2:20 PM
Subject: Re: validation wierdness possibly related to multiple struts config
files


> finally solved it.
>
> When you have the following DTD definition in your validation.xml file
> snip=
> <!DOCTYPE form-validation PUBLIC
>           "-//Apache Software Foundation//DTD Commons Validator Rules
> Configuration 1.0//EN"
>           "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
> =snip
> It breaks.
>
> When you have the following DTD definition in your validation.xml file *
> *snip=
> <!DOCTYPE form-validation SYSTEM
> "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">
> =snip*
> *It works
>
> When you have the following DTD definition in your validation.xml file
> snip=
> <!DOCTYPE form-validation SYSTEM
> "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
> =snip
> It works.
>
>
> --b
>
> Bryan Hunt wrote:
>
> > Ok , dunno who to report this to but this validator stuff needs to be
> > looked at before this
> > is released to the public cause it's a bit of a mess.
> >
> > Just noticed that the version of validator-rules that is distributed
> > is for the validator_1_1.dtd version.
> >
> > I think somebody needs to take a little look at this. It doesn't seem
> > to know whether to do
> > 1.1 or 1.2 stuff. Some of the behaviour is from one and some from the
> > other.
> >
> > --b
> >
> > Bryan Hunt wrote:
> >
> >> Thank you Bill, your answer was correct. I've found that
> >> commons-validator as distibuted with the latest
> >> 1.2.1 version of struts doesn't include the
> >> http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
> >> file. So despite my specifying the DTD like so
> >> snip=
> >>
> >> <!DOCTYPE form-validation PUBLIC
> >>          "-//Apache Software Foundation//DTD Commons Validator Rules
> >> Configuration 1.0//EN"
> >>          "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
> >> =snip
> >>
> >> I've copied the following files over to my libs dir.
> >>
> >> snip=
> >> 08/07/2004  09:26              358,273 antlr.jar
> >> 08/07/2004  09:26              118,726 commons-beanutils.jar
> >> 08/07/2004  09:26              165,119 commons-collections.jar
> >> 08/07/2004  09:26              109,096 commons-digester.jar
> >> 08/07/2004  09:26               22,379 commons-fileupload.jar
> >> 08/07/2004  09:26               38,015 commons-logging.jar
> >> 08/07/2004  09:26               84,260 commons-validator.jar
> >> 08/07/2004  09:26               65,425 jakarta-oro.jar
> >> 08/07/2004  09:26              520,842 struts.jar
> >> =snip
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



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


Re: validation wierdness possibly related to multiple struts config files

Posted by Bryan Hunt <ad...@revoltingdigits.com>.
finally solved it.

When you have the following DTD definition in your validation.xml file
snip=
<!DOCTYPE form-validation PUBLIC
          "-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.0//EN"
          "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
=snip
It breaks.

When you have the following DTD definition in your validation.xml file *
*snip=
<!DOCTYPE form-validation SYSTEM
"http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">
=snip*
*It works

When you have the following DTD definition in your validation.xml file
snip=
<!DOCTYPE form-validation SYSTEM
"http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
=snip
It works.


--b

Bryan Hunt wrote:

> Ok , dunno who to report this to but this validator stuff needs to be 
> looked at before this
> is released to the public cause it's a bit of a mess.
>
> Just noticed that the version of validator-rules that is distributed 
> is for the validator_1_1.dtd version.
>
> I think somebody needs to take a little look at this. It doesn't seem 
> to know whether to do
> 1.1 or 1.2 stuff. Some of the behaviour is from one and some from the 
> other.
>
> --b
>
> Bryan Hunt wrote:
>
>> Thank you Bill, your answer was correct. I've found that 
>> commons-validator as distibuted with the latest
>> 1.2.1 version of struts doesn't include the 
>> http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
>> file. So despite my specifying the DTD like so
>> snip=
>>
>> <!DOCTYPE form-validation PUBLIC
>>          "-//Apache Software Foundation//DTD Commons Validator Rules 
>> Configuration 1.0//EN"
>>          "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
>> =snip
>>
>> I've copied the following files over to my libs dir.
>>
>> snip=
>> 08/07/2004  09:26              358,273 antlr.jar
>> 08/07/2004  09:26              118,726 commons-beanutils.jar
>> 08/07/2004  09:26              165,119 commons-collections.jar
>> 08/07/2004  09:26              109,096 commons-digester.jar
>> 08/07/2004  09:26               22,379 commons-fileupload.jar
>> 08/07/2004  09:26               38,015 commons-logging.jar
>> 08/07/2004  09:26               84,260 commons-validator.jar
>> 08/07/2004  09:26               65,425 jakarta-oro.jar
>> 08/07/2004  09:26              520,842 struts.jar
>> =snip
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


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


Re: validation wierdness possibly related to multiple struts config files

Posted by Bryan Hunt <ad...@revoltingdigits.com>.
Ok , dunno who to report this to but this validator stuff needs to be 
looked at before this
is released to the public cause it's a bit of a mess.

Just noticed that the version of validator-rules that is distributed is 
for the validator_1_1.dtd version.

I think somebody needs to take a little look at this. It doesn't seem to 
know whether to do
1.1 or 1.2 stuff. Some of the behaviour is from one and some from the 
other.

--b

Bryan Hunt wrote:

> Thank you Bill, your answer was correct. I've found that 
> commons-validator as distibuted with the latest
> 1.2.1 version of struts doesn't include the 
> http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
> file. So despite my specifying the DTD like so
> snip=
>
> <!DOCTYPE form-validation PUBLIC
>          "-//Apache Software Foundation//DTD Commons Validator Rules 
> Configuration 1.0//EN"
>          "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
> =snip
>
> I've copied the following files over to my libs dir.
>
> snip=
> 08/07/2004  09:26              358,273 antlr.jar
> 08/07/2004  09:26              118,726 commons-beanutils.jar
> 08/07/2004  09:26              165,119 commons-collections.jar
> 08/07/2004  09:26              109,096 commons-digester.jar
> 08/07/2004  09:26               22,379 commons-fileupload.jar
> 08/07/2004  09:26               38,015 commons-logging.jar
> 08/07/2004  09:26               84,260 commons-validator.jar
> 08/07/2004  09:26               65,425 jakarta-oro.jar
> 08/07/2004  09:26              520,842 struts.jar
> =snip


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


Re: validation wierdness possibly related to multiple struts config files

Posted by Bryan Hunt <ad...@revoltingdigits.com>.
Thank you Bill, your answer was correct. I've found that 
commons-validator as distibuted with the latest
1.2.1 version of struts doesn't include the 
http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd
file. So despite my specifying the DTD like so
snip=

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

I've copied the following files over to my libs dir.

snip=
08/07/2004  09:26              358,273 antlr.jar
08/07/2004  09:26              118,726 commons-beanutils.jar
08/07/2004  09:26              165,119 commons-collections.jar
08/07/2004  09:26              109,096 commons-digester.jar
08/07/2004  09:26               22,379 commons-fileupload.jar
08/07/2004  09:26               38,015 commons-logging.jar
08/07/2004  09:26               84,260 commons-validator.jar
08/07/2004  09:26               65,425 jakarta-oro.jar
08/07/2004  09:26              520,842 struts.jar
=snip

It still appears to be still validating using an old dtd and throws the 
following exception.

wierd ... wierd ... wierd

15-Jul-2004 13:22:07 org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 30 column 21: The content of element type 
"field" mu
st match "(msg|arg0|arg1|arg2|arg3|var)*".
org.xml.sax.SAXParseException: The content of element type "field" must 
match "(
msg|arg0|arg1|arg2|arg3|var)*".
        at 
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
known Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
Source)
        at 
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
ource)
        at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown 
Source)

        at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
n Source)
        at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
        at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1581)
        at 
org.apache.commons.validator.ValidatorResources.<init>(ValidatorResou
rces.java:153)
        at 
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl
ugIn.java:233)
        at 
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java
:164)
        at 
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
t.java:839)
        at 
org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
        at javax.servlet.GenericServlet.init(GenericServlet.java:256)
        at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1044)
        at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88
7)
        at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3853)
        at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
168)
        at 
org.apache.catalina.core.StandardContext.reload(StandardContext.java:
2897)
        at 
org.apache.catalina.core.StandardContext.backgroundProcess(StandardCo
ntext.java:4472)
        at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1658)
        at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p
rocessChildren(ContainerBase.java:1667)
        at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p

I've tried getting the latest version from 
http://cvs.apache.org/builds/jakarta-commons/nightly/commons-validator/
and despite it including the 1.2 dtd the problem persists, perhaps I am 
brain dead but I can't figure this out.

--b

Bill Siggelkow wrote:

> Are you using Struts 1.2 or the nightly build? I had this issue the 
> other day and I think I got around it by using the new <arg> element 
> instead of <arg0> -- simply change arg0 to arg in your validation.xml.
>
> <arg key="label.oldPassword"/>
>
> Or you can try using the new position attribute:
>
> <arg key="label.oldPassword" position="0"/>
>
> Bill Siggelkow
>
>
> Bryan Hunt wrote:
>
>> I have the following jsp page
>> snip=
>> <html:errors/>
>>  <table width="712" border="0">
>>    <tr>
>>      <td width="197">
>>        <html:form action="/client-change-password-action">
>>          <table>
>>            <tr>
>>              <th align="right"><bean:message 
>> key="label.oldPassword"/>:</th>
>>              <td>
>>                <html:text property="oldPassword"/>
>>              </td>
>> etc etc etc
>> =snip
>>
>> I have 4 struts config files default.xml,client.xml,admin.xml,sales.xml
>>
>> They are declared as so in my web.xml file.
>> snip=
>> <init-param>
>> <param-name>config</param-name>
>> <param-value>/WEB-INF/struts/default.xml,
>> /WEB-INF/struts/client.xml,
>> /WEB-INF/struts/sales.xml,
>> /WEB-INF/struts/admin.xml
>> </param-value>
>> </init-param>
>> =snip
>>
>> The default.xml contains the following lines which work just fine for 
>> everything else
>> snip=
>> <message-resources parameter="ie.jestate.web.ApplicationResources"/>
>>
>> <!-- Plug Ins Configuration -->
>>
>>  <plug-in className="org.apache.struts.tiles.TilesPlugin" >
>>    <set-property property="definitions-config" 
>> value="/WEB-INF/tiles/default-defs.xml,/WEB-INF/tiles/client-defs.xml,/WEB-INF/tiles/sales-defs.xml,/WEB-INF/tiles/admin-defs.xml" 
>> />
>>    <set-property property="moduleAware" value="true" />
>>    <set-property property="definitions-parser-validate" value="true" />
>>  </plug-in>
>>
>>   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
>>    <set-property property="pathnames" 
>> value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
>>  </plug-in>
>> =snip
>>
>> My validation.xml file has the following relevant lines ...
>> snip=
>>  <form name="ClientChangePasswordForm">
>>            <field property="oldPassword" depends="required">
>>            <arg0 key="label.oldPassword"/>
>>            </field>
>>            <field property="newPassword" depends="required">
>>            <arg0 key="label.newPassword"/>
>>            </field>
>>            <field property="confirmNewPassword" depends="required">
>>            <arg0 key="label.confirmNewPassword" />
>>            </field>
>>        </form>
>> =snip
>>
>> My ApplicationResources.properties file has the following content
>> snip=
>> label.oldPassword=Old Password
>> label.newPassword=New Password
>> label.confirmNewPassword=Confirm New Password
>> errors.required={0} is required.<br>
>> errors.minlength={0} cannot be less than {1} characters.<br>
>>
>> =snip
>> Now everything works fine including the labels (ie <bean:message 
>> key="label.oldPassword"/> ) but when
>> the form is submitted but not all the fields are filled out I get the 
>> following messages ( output from <html:errors/>.
>>
>> null is required.
>> null is required.
>> null is required.
>>
>> Is this possibly a Struts bug or is it too late in the day and I 
>> drink to many units at the weekend being an Irishman ?
>>
>> --b
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

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


Re: Re: validation wierdness possibly related to multiple struts config files

Posted by bryan <ni...@gmail.com>.
I am using a nightly build from about 1 week ago. I never updated my
dtd for validator though. Im going to do that and check out your
suggestion. Never occured to me that it mightnt be backwards
compatatable.

--b

On Tue, 13 Jul 2004 15:52:41 -0400, Bill Siggelkow
<bi...@bellsouth.net> wrote:
> Are you using Struts 1.2 or the nightly build? I had this issue the
> other day and I think I got around it by using the new <arg> element
> instead of <arg0> -- simply change arg0 to arg in your validation.xml.
> 
> <arg key="label.oldPassword"/>
> 
> Or you can try using the new position attribute:
> 
> <arg key="label.oldPassword" position="0"/>
> 
> Bill Siggelkow
> 
> 
> 
> 
> Bryan Hunt wrote:
> > I have the following jsp page
> > snip=
> > <html:errors/>
> >  <table width="712" border="0">
> >    <tr>
> >      <td width="197">
> >        <html:form action="/client-change-password-action">
> >          <table>
> >            <tr>
> >              <th align="right"><bean:message
> > key="label.oldPassword"/>:</th>
> >              <td>
> >                <html:text property="oldPassword"/>
> >              </td>
> > etc etc etc
> > =snip
> >
> > I have 4 struts config files default.xml,client.xml,admin.xml,sales.xml
> >
> > They are declared as so in my web.xml file.
> > snip=
> > <init-param>
> > <param-name>config</param-name>
> > <param-value>/WEB-INF/struts/default.xml,
> > /WEB-INF/struts/client.xml,
> > /WEB-INF/struts/sales.xml,
> > /WEB-INF/struts/admin.xml
> > </param-value>
> > </init-param>
> > =snip
> >
> > The default.xml contains the following lines which work just fine for
> > everything else
> > snip=
> > <message-resources parameter="ie.jestate.web.ApplicationResources"/>
> >
> > <!-- Plug Ins Configuration -->
> >
> >  <plug-in className="org.apache.struts.tiles.TilesPlugin" >
> >    <set-property property="definitions-config"
> > value="/WEB-INF/tiles/default-defs.xml,/WEB-INF/tiles/client-defs.xml,/WEB-INF/tiles/sales-defs.xml,/WEB-INF/tiles/admin-defs.xml"
> > />
> >    <set-property property="moduleAware" value="true" />
> >    <set-property property="definitions-parser-validate" value="true" />
> >  </plug-in>
> >
> >   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
> >    <set-property property="pathnames"
> > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> >  </plug-in>
> > =snip
> >
> > My validation.xml file has the following relevant lines ...
> > snip=
> >  <form name="ClientChangePasswordForm">
> >            <field property="oldPassword" depends="required">
> >            <arg0 key="label.oldPassword"/>
> >            </field>
> >            <field property="newPassword" depends="required">
> >            <arg0 key="label.newPassword"/>
> >            </field>
> >            <field property="confirmNewPassword" depends="required">
> >            <arg0 key="label.confirmNewPassword" />
> >            </field>
> >        </form>
> > =snip
> >
> > My ApplicationResources.properties file has the following content
> > snip=
> > label.oldPassword=Old Password
> > label.newPassword=New Password
> > label.confirmNewPassword=Confirm New Password
> > errors.required={0} is required.<br>
> > errors.minlength={0} cannot be less than {1} characters.<br>
> >
> > =snip
> > Now everything works fine including the labels (ie <bean:message
> > key="label.oldPassword"/> ) but when
> > the form is submitted but not all the fields are filled out I get the
> > following messages ( output from <html:errors/>.
> >
> > null is required.
> > null is required.
> > null is required.
> >
> > Is this possibly a Struts bug or is it too late in the day and I drink
> > to many units at the weekend being an Irishman ?
> >
> > --b
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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


Re: validation wierdness possibly related to multiple struts config files

Posted by Bill Siggelkow <bi...@bellsouth.net>.
Are you using Struts 1.2 or the nightly build? I had this issue the 
other day and I think I got around it by using the new <arg> element 
instead of <arg0> -- simply change arg0 to arg in your validation.xml.

<arg key="label.oldPassword"/>

Or you can try using the new position attribute:

<arg key="label.oldPassword" position="0"/>

Bill Siggelkow


Bryan Hunt wrote:
> I have the following jsp page
> snip=
> <html:errors/>
>  <table width="712" border="0">
>    <tr>
>      <td width="197">
>        <html:form action="/client-change-password-action">
>          <table>
>            <tr>
>              <th align="right"><bean:message 
> key="label.oldPassword"/>:</th>
>              <td>
>                <html:text property="oldPassword"/>
>              </td>
> etc etc etc
> =snip
> 
> I have 4 struts config files default.xml,client.xml,admin.xml,sales.xml
> 
> They are declared as so in my web.xml file.
> snip=
> <init-param>
> <param-name>config</param-name>
> <param-value>/WEB-INF/struts/default.xml,
> /WEB-INF/struts/client.xml,
> /WEB-INF/struts/sales.xml,
> /WEB-INF/struts/admin.xml
> </param-value>
> </init-param>
> =snip
> 
> The default.xml contains the following lines which work just fine for 
> everything else
> snip=
> <message-resources parameter="ie.jestate.web.ApplicationResources"/>
> 
> <!-- Plug Ins Configuration -->
> 
>  <plug-in className="org.apache.struts.tiles.TilesPlugin" >
>    <set-property property="definitions-config" 
> value="/WEB-INF/tiles/default-defs.xml,/WEB-INF/tiles/client-defs.xml,/WEB-INF/tiles/sales-defs.xml,/WEB-INF/tiles/admin-defs.xml" 
> />
>    <set-property property="moduleAware" value="true" />
>    <set-property property="definitions-parser-validate" value="true" />
>  </plug-in>
> 
>   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
>    <set-property property="pathnames" 
> value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
>  </plug-in>
> =snip
> 
> My validation.xml file has the following relevant lines ...
> snip=
>  <form name="ClientChangePasswordForm">
>            <field property="oldPassword" depends="required">
>            <arg0 key="label.oldPassword"/>
>            </field>
>            <field property="newPassword" depends="required">
>            <arg0 key="label.newPassword"/>
>            </field>
>            <field property="confirmNewPassword" depends="required">
>            <arg0 key="label.confirmNewPassword" />
>            </field>
>        </form>
> =snip
> 
> My ApplicationResources.properties file has the following content
> snip=
> label.oldPassword=Old Password
> label.newPassword=New Password
> label.confirmNewPassword=Confirm New Password
> errors.required={0} is required.<br>
> errors.minlength={0} cannot be less than {1} characters.<br>
> 
> =snip
> Now everything works fine including the labels (ie <bean:message 
> key="label.oldPassword"/> ) but when
> the form is submitted but not all the fields are filled out I get the 
> following messages ( output from <html:errors/>.
> 
> null is required.
> null is required.
> null is required.
> 
> Is this possibly a Struts bug or is it too late in the day and I drink 
> to many units at the weekend being an Irishman ?
> 
> --b


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