Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ValidatorActionForm

 
Tim Vernon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Struts 1.3.8 and there is no ValidatorActionForm class in package org.apache.struts.validator

Was this moved somewhere else? Where can i download the correct jar that contains this class?
 
Stevi Deter
Ranch Hand
Posts: 265
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim,

ValidatorActionForm is in the struts-extras.jar. For more info, check out:
Struts Extras
 
Tim Vernon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I got the ValidatorActionForm to work. Now the problem is, I have multiple actions, 5, that all do the same validations of a form, then I have 5 more that do different validations on the same form. Is there any way I can specify this in the validation.xml so that I do not have to repeat the code for the actions that use the same validations?
 
Stevi Deter
Ranch Hand
Posts: 265
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim,

Create one formBean for each set of validations, then map the actions to the relevant formBean.

In struts-config.xml, you can define multiple formBeans that are backed by the same type.

Look at struts-examples-1.3.8.war for examples.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic