1

I have a object-String pair in the Map collection. I need to display object values as well as String on the table in the JSP along with radio button selection.

How do I do this, as per my knowledge the spring displaytag does not support Map.

Please help

Code:

below is the formBackingObject function, how do I display this in the jsp form?

public class ABCListingController extends SimpleFormController {

@Override
protected Object formBackingObject(HttpServletRequest request)
        throws Exception {
    DTO dmDto = new DTO();
    Map<ABC, Integer> matrix = new HashMap<ABC, Integer>();
    matrix = functionCall();

    dmDto.setMatrix(matrix);
    return dmDto;
}
}

jsp:

<c:forEach items="${matrix}" var="entry">
<tr>
    <td><input type="radio" id="selected"
        value="${entry.key.abcId}"></td>
    <td><c:out value="${entry.key.abcVar}" />
<tr>
</c:forEach>

<div style="text-align: center">
    <input type="submit" value="Submit" />
</div>

But how do I get the submitted data in onsubmit of the controller?

coder
  • 400
  • 1
  • 7
  • 19
  • Show us some code, and explain what you want to achieve in a more detailed way (examples are welcome). Tell us what you tried. And side note: displaytag has nothing to do with Spring. – JB Nizet May 17 '13 at 15:14
  • http://stackoverflow.com/questions/1835683/how-to-loop-through-a-hashmap-in-jsp – Ric May 17 '13 at 15:19
  • I tried that already, got it in a form too. But I don't understand how to get the submitted data in onSubmit method of the controller this way. – coder May 17 '13 at 15:24
  • Updated the question with more code. – coder May 17 '13 at 15:51

0 Answers0