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

  • Home
  • SEARCH
  • 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 8641339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:30:07+00:00 2026-06-12T11:30:07+00:00

Validation is working fine. On Add action loading the new form for the user

  • 0

Validation is working fine. On Add action loading the new form for the user to fill in. Once submitted the validation is done on processAdd(). All is fine.

Problem:

User fill in the form at http://localhost:8000/Struts2_Spring_Crud/student/add.When submitted than processed & validated through http://localhost:8000/Struts2_Spring_Crud/student/processAdd. If validation failed my url is /processAdd. I want to be at /add when validation fails. Is there any way to do this?

<s:form action="processAdd" method="POST">
    <s:submit method="execute" value="#title"/>
 </s:form>

  public String execute() throws Exception {
        System.out.println("execute() executed");
        //Process form data
        return SUCCESS;
    }

    public String input() throws Exception {
        System.out.println("input() executed");
        //Prepare form data
        return INPUT;
    }

     <default-action-ref name="list"/>
        <action name="list" class="com.myapp.actions.StudentAction" method="getAllStudents">
            <result name="success" type="tiles">/student.list.tiles</result>
        </action>

        <action name="add" class="com.myapp.actions.StudentAction" method="input">
            <result name="input" type="tiles">/student.edit.tiles</result>
            <result name="failure" type="tiles">/student.edit.tiles</result>
        </action>

        <action name="processAdd" class="com.myapp.actions.StudentAction">
            <result name="success" type="redirectAction">list</result>
            <result name="input" type="tiles">/student.edit.tiles</result>
            <result name="failure" type="redirectAction">add</result>
        </action>
  • 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-06-12T11:30:09+00:00Added an answer on June 12, 2026 at 11:30 am

    try this:

    <action name="processAdd" class="com.myapp.actions.StudentAction">
      <result name="success" type="redirectAction">list</result>
      <result name="input" type="redirectAction">add</result>
      <result name="failure" type="redirectAction">add</result>
    </action>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have coded custom form validation. validation is working fine all browser but when
My form is working fine with the validations being done by PHP. I have
I am trying to add validation to a form that is submitted by ajax,
I have jquery validation code which is working fine in ff but the same
Client side Validation and ValidationSummary is working fine for my project (MVC4 + Razor
I'm doing jquery small animation of fade in to form validation This is working
I am working on some simple form validation and need some assistance. Basically, I
i have a jquery form validation in the master page and it works fine
I have designed a form which was working fine until about an hour ago.
I have a simple form that uses jQuery validation to notify the user of

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.