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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:56:05+00:00 2026-06-17T08:56:05+00:00

Im new to Spring MVC and trying to achive something that seems really simple.

  • 0

Im new to Spring MVC and trying to achive something that seems really simple. However i cannot get it to work or find any relevant examples.

Using Spring MCV 3.1 with annotations. I have a form with only one select-list in it.
When this form is submitted, i want to be able to have the id of the select-value submitted to my controller. Thats it!

I dont want to wrap this value in a Binding object, i’d just like to send it to the controller, preferably by get like this:
http://www.mydomain.com/admin/products?marketId=id

My Controller looks like this:

@RequestMapping(value = "/admin/products", method = RequestMethod.GET)
public ModelAndView getProducts(@RequestParam("marketId") String marketId) {

    ModelMap model = new ModelMap();

    // Logic to find products by marketId is not shown
    // ...

    model.addAttribute("products", products);

    return new ModelAndView("products", model);
}

I have not been able to create a jsp that compiles yet, but this is my latest jsp snippet:

<form:form method="GET" action="/admin/products.htms" methodParam="marketId" >
    <form:select path="marketId" items="${marketList}" onchange="this.form.submit();"/>
</form:form>

If anyone could help or point out some relevant examples i would be very grateful! I have looked at a lot of examples using a binding object to wrap the form-data, but as you can see im looking for something a bit simpler.

Cheers!

  • 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-17T08:56:06+00:00Added an answer on June 17, 2026 at 8:56 am

    If you don’t need features such as object binding and error reporting, you can use plain HTML form instead of <form:form>:

    <form method="GET" action="/admin/products.htms">
        <select name="marketId" onchange="this.form.submit();">
            <c:forEach var = "item" items="${marketList}">
                <option value = "${item}">${item}</option>
            </c:forEach>
        </select>
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im quite new to spring mvc. What I'm trying to achive is separating static
I'm new to Spring MVC and I'm trying to write a simple web app
I'm trying to get basic localization working in a new Spring MVC app. I've
I'm really new to Spring and Spring MVC and I'm working on a kind
I have a Spring MVC backend that needs to start handling new URLs that
I'm trying to get into the Spring MVC world and I'm starting by using
I´m new in spring-mvc. So, i´m trying to use RESTFull urls ( i think
I am new to spring. I am trying to use spring mvc to build
I am trying to understand architecture of Spring MVC. However, I am completely confused
I have been trying out the new Spring MVC 3.0 Type Conversion Framework. I

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.