I've done some work on a validation framework for
Struts that is based on defining rules in an xml file.
 Right now it depends on associating a field with a
page and setting a variable in the JSP page to set
what page you are on.  I had a long discussion with
someone on how to make it not depend on associating
fields with a page so it was separated from the view,
but I haven't had time to finish doing that.  The
biggest problem is that if you have a session scope
bean then you still absolutely have to know if there
is a checkbox field on the page so you can reset it. 
The best idea to get away from page numbers was to
have a custom ActionForward for each page and pass in
the checkbox fields to be reset along with the action.

Here is the url for what I currenty have working. 
There is a multi-page example in the validator.war and
jdbc-validator.war in the webapps directory.

http://home.earthlink.net/~dwinterfeldt

David Winterfeldt

--- Lukasz Kowalczyk <[EMAIL PROTECTED]> wrote:
> Hi.
> 
> I'm trying to employ Struts to help me build
> multi-page forms.
> Those forms consist of all kinds of inputs,
> including multipart.
> 
> The questions are as follows:
> 
> 1. How can I validate forms which I know will never
> set all of the
> required elements at a time since the required
> elements can span multiple
> pages? I could check which submit was clicked and
> then validate just a
> subset of form elements but I think it's not very
> Struts-oriented, and
> secondly this makes validate() method dependent on
> specific placement of
> form inputs (when I decide to move some field to
> another page I have to
> modify validate()).
> 
> 2. Can I use the same Action class to handle
> multipart and non-multipart
> request? Will performance hurt because of this?
> 
> -- 
> Łukasz Kowalczyk
> 


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to