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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:55:39+00:00 2026-06-11T13:55:39+00:00

I have to 4 objects, Group, sections and Questions and their options. Every Group

  • 0

I have to 4 objects, Group, sections and Questions and their options. Every Group has different Sections and Sections have Multiple Questions and Questions have options. Now I have to design form input system so that every group and sections can be covered up step by step. I’m doing all this in spring mvc.

Can you tell me a way, how can I solve this problem?

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

    You can surely do that in Spring MVC thanks to easy list binding.

    Spring MVC allows a big lot of freedom, so basically if you only use this framework, you will have to come up with a solution from scratch.
    Here is a use case and a solution. It is a bit tough to implement, as it is from scratch. Feel free to adapt it to your specific needs, add whatever fancy UI framework you want, but you should get a general idea. You can skip to part III for a quick answer.

    Let’s say you want to create/edit a group in one single page :

    • you want to edit/add sections to the group
    • you want to edit/add questions to any section
    • you want to edit/add options to any question

    I. Page design :

    1. You have a JSP Group page with one big single form (again this is just an example)
    2. There will be buttons to add nested stuff. When clicked, some javascript will show a blank form allowing with the information of the stuff. This blank form will itself have buttons to add nested nested stuff to it, and so on (until the stuff is an option).
    3. The design is the same for existing stuff that you want to display/edit, except that the forms won’t be blank
    4. You are able to tell whether you are creating or editing the current group (context of the page or javascript/html tricks).
    5. There may be a list of existing sections you could “drag & drop” inside a group thanks to some javascript/jQuery

    II. Code design :

    1. You have a GroupController corresponding to the JSP
    2. The Group object has a List<Section> sections attribute, the Section object has a List<Questions> questions attribute, etc.
    3. You have methods createGroup and editGroup
    4. When submitting your JSP form and calling createGroup or editGroup, you are able to know if the submitted elements of the group already exist, so you can decide to add or edit/update them in the DB. All this logic could be done in another class, like a Spring service.
    5. You always provide a possible list of existing sections (by adding this list to the model in both methods, or better yet, by doing a single method annotated with @ModelAttribute). This list could be computed in another class (a Service/DAO/both which taps the DB in the end).

    III. The magic : binding the JSP form with the Java controller :

    In the page you’ll have a <form:form commandName="group">, and in the controller methods parameters you’ll have a @ModelAttribute("group") Group group.

    Now, to submit the name of the very first option, you would have this in the JSP :

    <form:input path="sections[0].questions[0].options[0].name" />
    

    (or the equivalent in html generated by some javascript).

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

Sidebar

Related Questions

I have beans which have Objects which can contain different types. Now when I
So I have a form with some tab objects, group objects and possible a
I have an array Groups. Each of the group-objects has an attribute name. I
In my app, I have a group of 3d objects and they're exposed to
I have objects that has a DateTime property, how can i query for the
I have objects which create other child objects within their constructors, passing 'this' so
I have 2 Hibernate objects Group and User which are related with a ManyToMany
Let's say I have the following objects: Fxy.commands={ group:{ add:function(msg){ So, of course, Fxy.commands.group.add('something')
I have a newsletter application where a newsletter has multiple articles within each issue.
I have objects of a class Choice which are in a list. Choice looks

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.