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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:55:10+00:00 2026-05-13T01:55:10+00:00

we have a list of domain objects needing to be edited on an html

  • 0

we have a list of domain objects needing to be edited on an html page. For example, the command & domain objects:

class MyCommand {
    List<Person> persons;
}

class Person {
    String fname;
    String lname;
}

Then, the HTML I expect to have the Spring MVC tag libraries generate is like this:

<form>
   <input name="persons[0].fname">&nbsp;<input name="persons[0].lname"><br/>
   <input name="persons[1].fname">&nbsp;<input name="persons[1].lname"><br/>
   <input name="persons[2].fname">&nbsp;<input name="persons[2].lname"><br/>
   ...
   <input name="persons[n].fname">&nbsp;<input name="persons[n].lname"><br/>
</form>

But can’t see how to express this using the Spring Form Tag Libraries (using Spring 2.5.6.). I want to use the tag libraries so that it takes care of binding existing values to the tags for editing (when they’re there).

Any tips?

  • 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-13T01:55:10+00:00Added an answer on May 13, 2026 at 1:55 am

    There isn’t a way to simply have the Spring Form Tags generate the whole list based on the collection (it will do this for the options in a select box, but that’s the only collection-based expansion I’m aware of). However, you can still use the Spring Form Tags within a loop like so:

    <c:forEach var="person" varStatus="loopStatus" items="myCommand.persons">
       <form:input path="persons[${loopStatus.index}].fname" />&nbsp;<form:input path="persons[${loopStatus.index}].lname" /><br />
    </c:forEach>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of System.DirectoryServices.ActiveDirectory.Domain objects gotten via this method. How do I
I have found this example on StackOverflow: var people = new List<Person> { new
I have a library function that returns a list of domain objects from a
I have a List<int> and a List<customObject> . The customObject class has an ID
I have a list of objects I wish to sort based on a field
I have two domain classes: class A { String Name ... } class B
I'm having trouble selecting items from a list of domain objects based on a
I have a Java EE application and I use Hibernate. The domain objects, I
I'm using Grails 1.3.7. Let's say I have the domain objects Foo and Bar
I have three domain objects: Child, Classroom and ChildClassroom. Here are lists of each:

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.