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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:31:54+00:00 2026-06-14T20:31:54+00:00

I did a bit of searching, and it doesn’t appear that this specific question

  • 0

I did a bit of searching, and it doesn’t appear that this specific question has been asked (if I am mistaken, I apologize).

The application I’m working on processes reports on a set of data, and the reports are separated by client and the report category.

The issue I have is that the number of clients and categories varies for each job, so I need to dynamically generate the following form elements based on the requirements for each job.

<!-- CLIENT NAME -->
Inclusion Client Name:
    <form:errors path="clientName"  cssClass="error"/><br />
    <form:input path="clientName" />       
<br /><br />

<!-- REPORTING CCATEGORIES -->
Reporting Categories:
    <form:errors path="reportingCategories"  cssClass="error"/><br />
    <form:input path="reportingCategories" />       
<br /><br />
<!-- comma separated list of categories -->

In the process of testing some theories, I learned that you can point multiple form elements to the same path, and Spring will concatenate the values into a comma separated list. My only concern is the order in which these form elements are read.

<!-- CLIENT NAME A -->
Inclusion Client Name:
    <form:errors path="clientName"  cssClass="error"/><br />
    <form:input path="clientName" />       
<br /><br />

<!-- REPORTING CATEGORIES A -->
Reporting Categories:
    <form:errors path="reportingCategories"  cssClass="error"/><br />
    <form:input path="reportingCategories" />       
<br /><br />
<!-- comma separated list of categories -->

<!-- CLIENT NAME B -->
Inclusion Client Name:
    <form:errors path="clientName"  cssClass="error"/><br />
    <form:input path="clientName" />       
<br /><br />

<!-- REPORTING CATEGORIES B -->
Reporting Categories:
    <form:errors path="reportingCategories"  cssClass="error"/><br />
    <form:input path="reportingCategories" />       
<br /><br />
<!-- comma separated list of categories -->

In the second code snippet above, my test case reads CLIENT NAME A before CLIENT NAME B (Essentially working down the page from top to bottom). Will this always be the case?

  • 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-14T20:31:55+00:00Added an answer on June 14, 2026 at 8:31 pm

    Yes, the order will always be the order in which the form fields are defined in the form.

    When defining multiple fields with the same path, you also can bind them as an array in your request method like:

    @Controller
    public class YourController {
        @RequestMapping(....)
        public String foo(@RequestParam String clientName[], @RequestParam String reportingCategories[], BindingResult result) {
            ...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I did a fair bit of searching for an answer to this question, but
Aight, did a bit of Googling and searching here, the only question I found
I did a bit of searching for this and I'm hoping I'm not creating
I did a bit of searching but came up empty on this. I'm looking
First off, if this is a duplicate, I apologize. I did quite a bit
I did a bit of searching but couldn't find a definitive answer on this,
I did a bit of searching and found this thread on the topic but
I've searched quite a bit and found a few solutions that did not end
I know this topic is bit old, but i did surf the web and
I did quite a bit of searching around and didn't find anything of much

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.