• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validator Framework - Can we use same ActionForm for two different UI ?

 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using validator framework provided by struts.

We have a scenario where a single ActionForm is being used by two different pages.

If there are four elements in them, we need to validate two form elements for one Page and the other two form elements for the other page.

I am not sure where we need to specify the parameters( if there are any) for the validator framework to understand the correct validation that needs to be done.

Any help will be appreciated
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you list the ActionForm twice as two different names in form-beans of struts-config, using one for each Action, it becomes very simple to tell the difference between them in the validation framework.
 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark.

I thought about this option too, but i was thinking if i had any option to specify the particular Action Class that gets submitted in the Validator.xml file for my validations.

Thanks for your suggestion.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic