FormProc is a SourceForge project <http://formproc.sourceforge.net/>. It's a mature library that is used by the JPublish Framework and distributed under the Apache License. It is designed to capture a list of parameters, validate those parameters, and if valid, transfer the parameter to a target object. The target can be an arbitrary JavaBean or a Map. The list can be any List or extracted from a HttpServletRequest.
XML is only used as a deployment descriptor. I'm not talking about using a XML DOM in the workflow, only to use XML to define a more complete Form object than we see today in FormProc or the Validator.
I'm using FormProc in my current project now, along with Commons Chain and Maverick, and everything is lining up quite nicely. Soon, I'll port the work into a Struts context where it will be easier to see what I'm talking about.
Right now, I'm using FormProc to validate the input parameters and convert them directly into a target object (a Commons Chain context). If the validation fails, my Velocity markup is displaying the original input from a list maintained by FormProc. If the validation succeeds, the target object is passed down to the business layer, validated, converted, and ready to use.
In many ways, this approach is similar to where JavaServer Faces is going. The components have their own String cache, so you don't have to define one. Likewise, FormProc has its own input cache.
The missing piece right now is that I need to make the Converters bi-directional. When a target object comes back from the business layer, I'd like to hand it to the form object to convert back to a list of Strings. So if I have "12/31/2003" being converted to a Date, I can get a Date converted back to "12/31/2003", without writing any additional code.
The only place XML comes in is in defining the form object (a POJO). Right now, FormProc has the same sort of internal object that Validator would use, with the addition of a Converter property. I believe it would be useful to extend that object to include all the other properties we like to use in forms, like a label, a usage hint, an initial value, a default control type, and, in the case of a HTML control, the script triggers and so forth.
The goal being that we could hand the form object to a JSP tag, Velocimacro, or whatever, and have it render the markup for a default input form. Of course, in many case, a custom form might be needed instead, but it would at least be nice to have the option =:0) And, of course, you could define as few or as many of these properties as needed.
This is the same general direction JavaServer Faces is going with the DataGrid, but I'd like to generalize it for use with any type of input form.
-Ted.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]