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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:11:07+00:00 2026-05-20T22:11:07+00:00

So I have an object and I want to add a bunch of sub-objects

  • 0

So I have an object and I want to add a bunch of sub-objects to it (an undetermined number– the user just keeps saying “add one more”). (ie I have an iterator and I’d like to fill it with objects).

The project is struts2 so I’ve got a JSP which sends a form to an action class, which instatiates some objects and saves them to a database. Now I need to also instatiate and save an arbitrary number of objects. I can’t just use an iterator because I don’t know how many objects are going to be involved, and I’m having trouble getting an individual object from a Struts2 form and into the iterator.

Any ideas on a good way to do this, preferrably without java in my jsps?

Thanks!

  • 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-20T22:11:08+00:00Added an answer on May 20, 2026 at 10:11 pm

    It sounds like you need an ‘Add one more action’ which the user calls repeatedly with the details of the sub object. Then when you’ve added all your sub objects you call a different action which saves the Parent and child Collection of sub objects to the database.

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

Sidebar

Related Questions

I have an array of objects and I want to add another object just
I have this script where I want to add an object to an array
I have a scraping object basically. I want to be able to add POST
I have a situation where i want to add LinePragmas to CodeDom objects. But
I have just had a brain block, I have a Deck object and want
I have a bunch of things I want to add into an array, and
I have a bunch of directories. I want to build an object for each
I have a bunch of different objects(and objec types) that i want to write
I have an object and I want to detect what type is, so I
I have a DateTime object I want to compare against an sql datetime field

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.