From: Aapo L. <aap...@pr...> - 2003-04-08 08:30:38
|
> FormProc (from SourceForge) and Validator (from Jakarta). > I was curious if anyone has used a framework and what > your experience regarding these frameworks is. I have used FormProc. It's very easy. How I intagrated it was adding parameter to controller that tells the name of form. <controller ...> <param name="form" value"login" /> </controller> And here is the integration code: try { this.getContext().getParams().remove("form"); // this.form is automatically populated with BeanUtils. if (this.form != null) { FormManager fm = new FormManager(); HttpForm form = new HttpForm(this.form, null); fm.configure(form); // this.validationResults can be used by views. this.validationResults = form.process(this.getRequest()); if (!this.validationResults.isValid()) { log.debug("Form validation failed. Returning to input."); return INPUT; } } } catch (Exception e) { throw e; } |