cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Brunner ...@blumenstrasse.vol.at>
Subject Does FormValidatorAction work with 2.0.4?
Date Tue, 10 Dec 2002 14:43:22 GMT
Hello,

I am experiencing problems when trying to use FormValidatorAction.

Descriptor file:
<root>  
  <parameter name="lastname" type="string" max-len="255" 
nullable="no"/>
  <parameter name="firstname" type="string" max-len="255" 
nullable="no"/>
  <parameter name="birthdate" type="string" nullable="no"
             matches-regex="^[0-9]{2}\.[0-9]{2}\.[0-9]{4}$"/>
</root>

Sitemap:
....
<map:match pattern="url">
	<map:act type="form-validator">                        
		<map:parameter name="descriptor" value="file6"/>   
		<map:parameter name="validate" value="*"/>
                        
		<map:generate type="serverpages" src="file1"/>
		<map:transform src="file2"/>
		<map:serialize/> 
	</map:act>
                    
	<map:generate type="serverpages" src="file3"/>
	<map:transform src="file4"/>
	<map:serialize/>
</map:match>    
....

It reports that the validation fails when I omit the above-mentioned 
parameters. But max-len and matches-regex seem to be completely 
ignored:

Request string: ...?lastname=a&firstname=a&birthdate=INVALID
Log says:

DEBUG   (2002-12-10) 15:39.19:590   [sitemap.action.form-validator] 
(/cocoon/edit-admin/lp/newspeaker) 
Thread-10/AbstractComplementaryConfigurableAction: Using cached 
configuration for lp/form-speaker.xml
DEBUG   (2002-12-10) 15:39.19:590   [sitemap.action.form-validator] 
(/cocoon/edit-admin/lp/newspeaker) Thread-10/FormValidatorAction: 
Validating parameters as specified via 'validate' parameter
DEBUG   (2002-12-10) 15:39.19:591   [sitemap.action.form-validator] 
(/cocoon/edit-admin/lp/newspeaker) 
Thread-10/AbstractValidatorAction: Validating parameter: lastname 
using rule: lastname
DEBUG   (2002-12-10) 15:39.19:591   [sitemap.action.form-validator] 
(/cocoon/edit-admin/lp/newspeaker) 
Thread-10/AbstractValidatorAction: Validating string parameter 
lastname
DEBUG   (2002-12-10) 15:39.19:592   [sitemap.action.form-validator] 
(/cocoon/edit-admin/lp/newspeaker) 
Thread-10/AbstractValidatorAction: Validating parameter: firstname 
using rule: firstname
DEBUG   (2002-12-10) 15:39.19:592   [sitemap.action.form-validator] 
(/cocoon/edit-admin/lp/newspeaker) 
Thread-10/AbstractValidatorAction: Validating string parameter 
firstname
DEBUG   (2002-12-10) 15:39.19:593   [sitemap.action.form-validator] 
(/cocoon/edit-admin/lp/newspeaker) 
Thread-10/AbstractValidatorAction: Validating parameter: birthdate 
using rule: birthdate
DEBUG   (2002-12-10) 15:39.19:593   [sitemap.action.form-validator] 
(/cocoon/edit-admin/lp/newspeaker) 
Thread-10/AbstractValidatorAction: Validating string parameter 
birthdate
DEBUG   (2002-12-10) 15:39.19:594   [sitemap.action.form-validator] 
(/cocoon/edit-admin/lp/newspeaker) Thread-10/FormValidatorAction: 
All form params successfully validated


Restarting and cleaning up the work dir does not show any effects. 
What am I doing wroing?

SW: Cocoon 2.0.4, Tomcat 4.1.12, JDK 1.4.1_01, Linux

Thanks in advance!
-- 
Matthias Brunner <mb@blumenstrasse.vol.at>
PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89 D501
Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message