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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:26:52+00:00 2026-05-30T09:26:52+00:00

I have a rather simple use case. The actor is a manager who provides

  • 0

I have a rather simple use case. The actor is a manager who provides feedback to a list of employees.

The view displays a list of employees. The manager (user) can click on each employee upon which a feedback form opens up (inline) to capture the feedback.

I have a List<Employee> which I am using to construct the listing of employees on the page. I am not able to understand how to structure and capture the feedback. I intend to have a separate bean, Feedback which correspond to the feedback of a particular Employee.

I started by building <form:form> in a loop and did this:

<c:forEach var="employee" items="${employees}" varStatus="stat">
    <form:form action="${saveURL}" method="post" modelAttribute="feedback-${stat.index + 1}">
        <input type="submit" value="Submit Feedback"/>
    </form:form>
</c:forEach>

I am trying to keep the signature of my processAction method as follows:

@RequestMapping(params = "action=save")
public void saveFeedback(ActionRequest request, ActionResponse response, @ModelAttribute("feedback") Feedback feedback, Model model)

Unfortunately, I am not able to proceed with this as I feel I am missing some important design piece here.

How should I be structuring my <form:form> or saveFeedback method in order to achieve what I am trying to do?

  • 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-30T09:26:54+00:00Added an answer on May 30, 2026 at 9:26 am

    This is how I solved the problem. Instead of having a list of feedback forms for holding data specific to each iteration, I had to create a single feedback form with a list of Feedback domain objects.

    My FeedbackForm looks like this now:

    public class FeedbackForm {
        private List<Feedback> feedbacks;
    
        ...
    
        getters and setters
    }
    

    And typically, the Feedback class would look like:

    public class Feedback {
        private String feedback;
        private int rating;
    
        ...
    
        getters and setters
    }
    

    Now my JSP looks like:

    <portlet:actionURL var="saveURL">
        <portlet:param name="action" value="save" />
        <portlet:param name="index" value="${stat.index}" />
    </portlet:actionURL>
    
    <c:forEach var="employee" items="${employees}" varStatus="stat">
        <form:form action="${saveURL}" method="post" modelAttribute="feedbackForm">
            <form:input path="feedbacks[${stat.index}].feedback" />
            <form:input path="feedbacks[${stat.index}].rating" />
            <input type="submit" value="Submit Feedback"/>
        </form:form>
    </c:forEach>
    

    And lastly, my controller method looks like:

    @RequestMapping(params = "action=save")
    public void saveFeedback(ActionRequest request, ActionResponse response,
        @RequestParam("index") int index,
        @ModelAttribute("feedbackForm") FeedbackForm feedbackForm, Model model)
        throws PortletException {
    
        Feedback feedback = feedbackForm.getFeedbacks().get(index);
    
        logger.debug("Submitted feedback is {}", feedback);
    }
    

    The idea is that it is impossible to have multiple forms being submitted at the same time, although they may appear on the page at the same time. Basically, one can only click one submit button per form.

    Hope this helps someone in a similar situation.

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

Sidebar

Related Questions

My use case is simple. I have a root domain object which references a
I have a simple use case for a Thrift Server( TSimpleServer ) wherein I
I have a simple form that I use to list the names of all
We have a rather simple site (minimal JS) with plain html and CSS. It
I will try to keep this as simple as possible. I have a rather
Heavy emphasis on simple. I've never made an installer and I'd rather not have
I'm rather new to WPF, so maybe this is a simple question. I have
I'm rather new to C and have recently been working on making a simple
I have a rather simple question and forgive me if it is sacrilege to
Here a sample use case: I request a simple form via an ajax request.

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.