Jaap van Hengstum wrote:
Can I ask why you are using FormProc and not Commons Validator? Since I've never used it yet, I was wondering FormProc has advantages over Validator.

The focus of the Validator is on validating JavaBeans. an interesting problem space, but it's not really what we need to fulfill a request processing cycle. What we need to do is to validate a list of parameters and then transfer those that pass to a target object. FormProc does exactly this. Validator only solves part of the problem (validation), while FormProc goes on to handles data transfer and type conversion.


It was also easy to modify FormProc to solve the nasty problem of redisplaying input. It already kept a list of the original parameters, so all we had to do is expose the list. (The patch I was waiting for.)

Next, I'd like to extend FormProc to support bidirectional conversions. Now it will take a String like 12/31/2003 and spit out a Date type. Next, I'd like to be able to give it a Date and have it spit out the 12/31/2003 String, without any additional coding.

The use case being that I have a Date coming back from the Model, and I want to display it using the same String format we expect for input.

Finally, I'd like to extend the form properties so that there is enough information in the form object to create a basic input form. The goal being able to hand a form object to a Velocimacro and haven it render a vanilla data-entry form (or read-only form). Or, more likely, being able to call a Velocimacro to render the simple fields, and mix and match those with hand-coded ones as needed.

FormProc is much closer to where I want to go than Validator, so that's where I started :)

-Ted.




------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf [INVALID FOOTER]

Reply via email to