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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:52:09+00:00 2026-06-17T16:52:09+00:00

I am designing a jsp page, where users can select values from a dropdown

  • 0

I am designing a jsp page, where users can select values from a dropdown like:

Row1: Select “dropdown”

Row2: Select “dropdown”

Row3: Select “dropdown1” “dropdown2”

where:

dropdown values are {1,2,3,4,5,6,7}

Users can select the values from the above rows and save the form. The next time the user views the page and the saved values are retrieved from the database, I want to display them in the dropdowns. For
that I am using Spring MVC form:select automatic binding

<form:select id="${id}" path="Mappings[${index}].userSetting">
            <c:forEach var="item" items="${dropdownValues}">
                <form:option value="${item.value}"><spring:eval expression="item" /></form:option>
            </c:forEach>
</form:select>

The code works fine for Row1 and Row2 which only have 1 dropdown to bind to. But in case of Row3,
the Mappings[${index}].userSetting returns values like “2,3” (instead of a single value), which are from the dropdownValues list but comma delimited. In this case, for obvious reasons
Spring MVC form:select fails to select values from the dropdown because “2,3” cannot be found in either of dropdowns.
What I am trying to do is to split the values so that from the “2,3”, the value “2” and “3” are selected such that Row3 looks like:

Before: Select “dropdown1” “dropdown2”
After: Select “2” “3”

Does anyone have a suggestion for how to accomplish this?

  • 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-17T16:52:10+00:00Added an answer on June 17, 2026 at 4:52 pm

    Have you thought about the fn:split() function.

    Here an example of what you could do :

    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    
    <c:set var="row3Value" value="${fn:split(model.getMappings()[${index}].userSetting, ',')}" />
    
    <form:select id="${id}" path="Mappings[${index}].userSetting">
        <c:forEach var="item" items="${dropdownValues}">
            <c:choose>
                <c:when test="${row3Value[0] eq ${item.value}}">
                    <form:option selected="true" value="${item.value}"><spring:eval expression="item" /></form:option>
                </c:when>
    
                <c:otherwise>
                    <form:option value="${item.value}"><spring:eval expression="item" /></form:option>
                </c:otherwise
            </c:choose> 
        </c:forEach>
    </form:select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have some knowledge of css,jQuery,Grails,django,servlets and jsp still i can't see me designing
I am designing a secure login with JSP. I intend to use Form Authorization
When designing a form in the IDE, non-visual components (eg TMainMenus, TDatamodules) can be
while designing my user control, i encountered the following problem: i would like to
Im designing my school's website and I kind of want to do like a
I am designing a small website using HTML + JSP. This is my first
I just learnt basic Servlets and JSP technology and am designing a simple website
I have a JSP page that renders a block of HTML. In normal usage,
I am designing an application with Spring MVC3. I have to create a JSP
In designing the HTML and CSS for a page, when should I use img.className

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.