Announcement Announcement Module
No announcement yet.
Spring 3 use PersistentSet to nest form:input types on jsp Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring 3 use PersistentSet to nest form:input types on jsp

    I have a problem. I have an entity that has many Set into, and i want to generate a jsp form that can bind these sets. The problem is:

    i can't set the path of the form:input tag.


    public class Implant implements {
        // Fields
        private Integer id;
        private Set analyzers = new Set(0); //with some attributes like model etc
        private Set trainings = new HashSet(0);
        //getters and setters omitted

    <c:forEach items="${implant.analyzers}" varStatus="loop" var="item">
    <c:when test="${ eq 1}">
    <div id="implant.analyzers${loop.index}.wrapper" class="hidden">
    <div id="implant.analyzers${loop.index}.wrapper">
    <form:input path="implant.analyzers[${loop.index}].model" /> //HERE IS THE ERROR
    <form:input path="implant.analyzers[${loop.index}].privateaddress" /> //HERE IS THE ERROR
    the big problem is i cannot generate the correct path for the form:input!! i cannot get the array index because is not an array. Because the hibernate mapping, i cannot change the Set to ArrayList, or i get mappingexceptions.

    So, there is a way to do this with Sets?

    Thank you
    Last edited by gtazok; May 24th, 2012, 10:28 AM.