struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oren Livne <oli...@aoce.utah.edu>
Subject Two Struts validation problems
Date Sat, 03 Mar 2007 15:30:34 GMT
Dear All:

I have two problems with Validator. I'm using Struts 1.3.5, Tomcat 6.0.9 
and Java 1.6:
1) I have a form property that is an integer. When I set its validation 
rule to "integer", it
has no effect.
- The form field is populated with a zero value even if a letter is 
typed in the form
instead of a number. How do I make sure that a typing a string would 
result in a validation error?
- Should I use Strings for all my form properties or can I use integers? 
Or Integers?
- I am using PropertyUtil.copyProperties(). If I use Strings for all my 
form properties and integers
in my model's data transfer object, would it automatically convert the 
type of variables in this method?

2) A "validwhen" test condition seems to be ignored:
                <var>
                   <var-name>test</var-name>
                   <var-value>((*this* != null) or (newChildForm.comment 
== null))</var-value>
                </var>
This has a reference to a nested property of the form. Is that OK to use 
it in a test condition?

Thanks,
Oren

-- 
======================================================================
Oren Livne, Ph.D.
Research Assistant Professor of Mathematics
RUReady Software Architect

Academic Outreach and Continuing Education
1901 East South Campus Dr., Room 2197-D
University of Utah, Salt Lake City, UT 84112-9399
Tel  : (801) 581-6831     Cell: (801) 631-3885     Fax: (801) 585-5414
Email: olivne@aoce.utah.edu              Web:  http://ruready.net/oren
======================================================================

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


Mime
View raw message