Results 1 to 1 of 1
Thread: Commons validator
- 07-27-2007, 08:46 AM #1
Member
- Join Date
- Jul 2007
- Posts
- 1
- Rep Power
- 0
Commons validator
Hi.
I am trying to use this framework for a web project, which uses ajax validation for fields triggered by onChange event on client side.
According to this I can post to the server only the formname,fieldname and the value parameters.
I spent a lot of time to find out how should I configure the validator object to the validate a String or an Intiger instead of a bean.
I copied the code base from the example shipped with commons validator source so I think that the most part of code and configuration files are OK.
The example name of the form field is age so I initialized the validator in this way :
Validator validator = new Validator(resources, "ValidateBean", "age");
and use this code to pass the value to validate :
validator.setParameter(Validator.FIELD_PARAM, %String or Integer or whatever% );
Always got the result message that age parameter is required.
I even tried to debug what does it do, and it seemed that validator is works only for beans.
Are there any way to validate simple values (not beans) with commons validator?
Thanks,
Attila
Similar Threads
-
org.apache.commons.mail.EmailException: Cannot find valid hostname
By Ed in forum Advanced JavaReplies: 3Last Post: 07-25-2011, 03:19 PM -
sql validator
By Joe2003 in forum Advanced JavaReplies: 0Last Post: 02-07-2008, 05:23 PM -
Using jakarta-commons threadpool (Tomcat) through JNDI
By zrrbite in forum Advanced JavaReplies: 0Last Post: 12-14-2007, 12:47 PM -
Commons Library Framework 0.8.0
By JavaBean in forum Java SoftwareReplies: 0Last Post: 10-02-2007, 04:13 PM -
Struts Validator - JScript version of Validator ´validwhen´
By Felissa in forum Web FrameworksReplies: 1Last Post: 07-06-2007, 04:39 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks