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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:13:12+00:00 2026-06-12T13:13:12+00:00

In a simple Spring 3 MVC app I have a few drop downs that

  • 0

In a simple Spring 3 MVC app I have a few drop downs that don’t show any options.

The jsp form snippet is:

<form:form method="POST" commandName="carSelection">
        <form:errors path="*" cssClass="errorblock" element="div" />
        <table>
            <tr>
                <td>Car Make :</td>
                <td><form:select path="makes" multiple="false">
                      <form:options items="${makes}"/>
                    </form:select>
                                </td>
                <td><form:errors path="makes" cssClass="error" /></td>
            </tr>

            <tr>
                <td>Car Make (SimpleList):</td>
                <td><form:select path="simpleModels" multiple="false">
                      <form:options items="${simpleModels}"/>
                    </form:select>
                                </td>
                <td><form:errors path="makes" cssClass="error" /></td>
            </tr>
            <tr>
                <td>Car Model :</td>
                <td>
                    <form:select path="models" items="${models}" multiple="false">
                        <form:option value="NONE" label="--- Select ---" />
                        <form:options items="${models}" itemValue="modelId" itemLabel="modelName"/>
                    </form:select>
                </td>
                <td><form:errors path="models" cssClass="error" /></td>
            </tr>

        </table>
    </form:form>

And the Controller class I have the following:

@Controller
@RequestMapping("/car")
public class CarController {

    /**
     * Initialise the car selection form
     * @param model
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/carSelectionForm")
    public ModelAndView loginForm() throws Exception {
        ModelAndView mav = new ModelAndView();
        CarSelection cs = new CarSelection();
        List<CarMake> makes = new ArrayList<CarMake>(5);
        makes.add(new CarMake(1, "Ford"));
        makes.add(new CarMake(2, "Fiat"));
        makes.add(new CarMake(3, "Renualt"));
        makes.add(new CarMake(4, "Kia"));
        makes.add(new CarMake(5, "Ferrari"));
        cs.setMakes(makes);

        List<String> simpleList = new ArrayList<String>(5);
        simpleList.add("Ford");
        simpleList.add("Fiat");
        simpleList.add("Renualt");
        simpleList.add("Kia");
        simpleList.add("Ferrari");
        cs.setSimpleModels(simpleList);

        mav.setViewName("carSelectionForm");
        mav.addObject("carSelection", cs);
        return mav;
    }   
}

The option for ‘NONE’ does render and is the only option that shows. Am I missing something basic?

  • 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-12T13:13:13+00:00Added an answer on June 12, 2026 at 1:13 pm

    You need to set the correct list in the options attribute items.

    <form:select path="makes" multiple="false">
       <form:options items="${carSelection.makes}"/>
    </form:select>
    
    
    <form:select path="simpleModels" multiple="false">
      <form:options items="${carSelection.simpleModels}"/>
    </form:select>
    

    But I have not the items for the 3. drop down in the controller

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

Sidebar

Related Questions

I have a pretty simple JSP/Servlet 3.0/Spring MVC 3.1 application. On one of my
I have my web application written in Spring MVC. It is quite simple app
I have a spring mvc app that I want to refactor out, speficially removing
I have a simple Spring MVC application that looks up some user details from
I have what I thought was a simple Spring MVC app. However, I can
I have a simple spring mvc app, using maven with intellij. How do you
I have a Spring MVC app that does not protect updates of user data
I'm trying to get a very simple Spring @mvc app to work and I'm
Lets assume a simple Spring MVC Controller that receives the ID of a domain
Have a simple Spring MVC portlet, and from one of portal pages I have

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.