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 6793161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:04:03+00:00 2026-05-26T18:04:03+00:00

On Spring with annotations, is there anyway that i can change the form action

  • 0

On Spring with annotations, is there anyway that i can change the form action without changing the action using javascript?

For example on submit1 method invoked on the controller = method1

on submit2 method invoked on the controller = method2

@RequestMapping("/submit1")
public String submit1()

@RequestMapping("/submit2")
public String submit2()

…

<form:form id="dynamicfrm" method="post" action="archive/submit.do" commandName="submit">
 <input type="submit1" value="">
 <input type="submit2" value="">

Thank you!

  • 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-26T18:04:04+00:00Added an answer on May 26, 2026 at 6:04 pm

    If I understand you correctly – as others already said it isn’t absolutely clear – than you want to map one single form to different action methods dependending on the button that was clicked.

    In your JSP you can change the code to something like this:

    <form action="/submit.do" method="post">
      <input type="submit" name="action" value="show">
      <input type="submit" name="action" value="edit">
    </form>
    

    And in your controller you can narrow the mappings like this:

    @RequestMapping(value = "/submit", params="action=show")
    public String showEntity() { /* ... */ }
    
    @RequestMapping(value = "/submit", params="action=edit")
    public String editEntity() { /* ... */ }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently migrating a project that is using Spring MVC without annotations to Spring
I'm working on a Spring 2.0 project, without annotations. We're using several PropertyPlaceholderConfigurer beans
I am using Spring annotations in my code to do the DI. So lets
I'm trying to combine Spring with Hibernate using Annotations and I'm getting the following
When moving to Spring 2.5.x I found that it adds more stereotype annotations (on
I am using Spring to inject beans. And I am using some annotations to
I'm using Spring 3, and trying to set up a simple web-app using annotations
Does anyone know if there any way that I can programmatically create a bean
Where can I find Spring 3 IoC JavaConfig (annotations) tutorial? If possible, please provide
How to handle isFormSubmission with Spring annotations, is there any annotation available to block

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.