facebook

Struts ValidatorActionForm

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #245144 Reply

    jlumnas
    Member

    Has anybody gotten the Struts ValidatorActionForm to work?

    I have two actions that use the same form and each action uses different elements of the form. From what I understand the ValidatorActionForm should take care of this by allowing me to map the action name to the validation process instead of the form name.

    Here is what I have done:
    1) Make my Form a sub class of the ValidatorAction Form;
    public class SearchForm extends ValidatorActionForm {

    2) Declare my action in the struts-config.xml:
    <action path=”/search”
    type=”org.apache.struts.actions.ForwardAction”
    name=”searchForm”
    scope=”request”
    input=””
    validate=”true”
    parameter=”/ui/Search.jsp>
    </action>
    3) Specify the action as the form name to be validated.

    <form name=”/search”>
    <field property=”filedDateFrom”
    depends=”date,mask”>
    <arg0 key=”label.fromDate”/>
    <var>
    <var-name>mask</var-name>
    <var-value>^[0-9]*$</var-value>
    </var>
    </field>
    </form>

    I have no validation method in the form and I have tried many combinations for the form name action “search”, “/search.action”, “search.action” and so forth.

    What happens is it skips the validation. If I put the form name in there it works fine.

    Any ideas?

    Thank You in advance

    Jeff Sulman

    #245165 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    Jeff,
    Don’t forget to ask your questions in the Struts mailing lists and/or the http://forums.java.sun.com forums, they can be very helpful for more general questions like this.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Struts ValidatorActionForm

You must be logged in to post in the forum log in