Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6631539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:33:36+00:00 2026-05-25T22:33:36+00:00

I am trying to validate a form using struts validation framework, but the validation

  • 0

I am trying to validate a form using struts validation framework, but the validation seems to be getting bypassed. I have all the validations setup in validation.xml.

I also have some custom form validations in the form’s validate() method which are running fine.

I have set the validate="false" in the action mapping and calling the form’s validate explicitly from the action’s doPerform()

I am on Struts 1.

Here’s some code:

Inside the action

if(validationPassed(changeForm, mapping, request)){
 if( !(changeForm.getResultAction().equals("add")) )
   if(!businessValidationsPassed(changeForm, request))
     errorFlag = true;
   }
   else{
        errorFlag = true;
   }

private boolean validationPassed(MultiChangeForm form, ActionMapping mapping, HttpServletRequest request ) {

  ActionErrors errors =  form.validate(mapping, request);
    if (!errors.isEmpty()) {
        saveErrors(request, errors);
        return false;
    }
    else
        return true;

}

struts-config.xml

<action path="/multiController"
            type="com.multi.action.MultiControllerAction"
            name="MultiChangeForm"  
            scope="session"
            input="multiUpdateResult.def"
            validate="false">
   <forward name="success" path="/forward/initProcess/cam/multiUpdateResultDef.do"/> 
        <forward name="failure" path="/forward/initProcess/cam/multiUpdateResultDef.do"/>
        <forward name="error" path="/forward/initProcess/cam/errorDef.do"/>

</action>

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames"
                  value="/WEB-INF/multi/validator-rules.xml,/WEB-INF/multi/validation.xml"/>
</plug-in>

form’s validate()

ActionErrors errors =  super.validate(actionMapping, request);
// custom validations: running ok

Am I missing something over here? Any ideas would be really great.

Thanks

Sahil

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:33:36+00:00Added an answer on May 25, 2026 at 10:33 pm

    When validation of the form fails, you are sent to the input page specified in the <action> tag, so I don’t know why you are calling the validate method manually.

    Anyways…. what I suspect is that your MultiChangeForm form is extending ActionForm when in fact it should extend ValidatorForm.

    Are you extending ValidatorForm?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to validate a form using Data Annotation. It seems great for string
I have a simple form with fields that I am trying to validate using
I'm using this jQuery validation plugin and getting the famous: $(#Form).validate is not a
I am trying to validate a form using Spring with integrated JSR-303 validations with
I'm trying to validate a form using an AJAX call to check available inventory.
My form is submitted by a link using JavaScript, but I am also trying
I have a jQuery Dialog form and on submit I'm trying to validate the
I am trying to validate some form fields but it always errors out on
Im using the bog standard form validation plugin. I have two radio buttons 'yes'
I'm trying to validate a form using the validate plugin for jquery. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.