struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Schneider <bschnei...@vecna.com>
Subject first impressions of struts
Date Tue, 18 Feb 2003 13:19:21 GMT
Hi,

I just downloaded Struts 1.1-b3  and wanted to share some feedback from my
first run-through with it.

* It took me a while to figure out why validation wasn't triggering.  It
seemed like I ought to be able to do something like this in validation.xml:

<form name="dynForm"><field property="x" depends="integer"> ....

and in struts-config.xml:
<form-bean name="dynForm"
type="org.apache.struts.validator.DynaValidatorForm">
  <form-property name="x" type="java.lang.Integer"/>
  <form-property name="s" type="java.lang.String"/>
</form-bean>

Yet whenever I specified a non-numeric value for "x", I never saw the
validation error server-side.  Client-side (javascript) validation worked,
and server-side validation errors for the string field worked.  If I changed
the type of x in <form-property> to java.lang.String, *then* server-side
validation worked too.  (Same behavior with a static form with setX/getX
methods.)

All I can think of is that somewhere, there must be a swallowed exception
during the set-properties cycle that prevents the validator from triggering.
Being able to do this kind of type coercion transparently with dynamic forms
would be useful; any suggestions?

* having to restart every time I edited struts-config.xml got tiring very
quickly.  Is there a better way with Tomcat 4.x?

* configuring struts logging is non-obvious.  I know it uses commons-logging
but I'm not sure where to tap into the configuration.

* dynamic form support is great.  I can use Struts just for validation
without writing a single class.  I can even implement my "actions" right in
JSP pages for rapid prototyping.

Thanks!

-- Bill



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


Mime
View raw message