Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

branching webapp using single DynaValidatorForm  RSS feed

Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My situation is this. I have a web app where the first page contains a set of radio buttons. Depending on what radio you select, the next screens will ask for different info. Eventually, both branches will show the same "confirm your request" page with "yes" and "no" buttons. "no" will nuke any session data and restart the app..."yes" will call an action which can forward you to either the "success" or "failure" page.

I would like to use DynaValidatorForm beans declared in the struts config file along with a dispatch action (since the business logic is very simple) and the validator.

I've read where you can use the "page" attr of the <field> tag in the validation config, which instructs the validator which fields to actually validate depending on what view the user came from.

Question is, if the web app branches, can you still use a single form design? The documentation reads that the validator will run validations on any page equal to or less then the current incoming page. For instance, I have two "page 2s": Page 2 on branch A and Page 2 on branch B. If page 3 on branch A tries to validate, it's going to run the validations for page 2 on both braches....will it not?

I like the simplicity of one form that multiple JSP are populating, but I don�t see how I can do this _and_ use the validator FW.

Any suggestions?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!