Announcement Announcement Module
Collapse
No announcement yet.
Spring 3 use PersistentSet to nest form:input types on jsp Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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.

    Data:

    Code:
    public class Implant implements java.io.Serializable {
    
        // 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
        }
    Jsp

    Code:
    <c:forEach items="${implant.analyzers}" varStatus="loop" var="item">
    <c:choose>
    <c:when test="${item.id eq 1}">
    <div id="implant.analyzers${loop.index}.wrapper" class="hidden">
    </c:when>
    <c:otherwise>
    <div id="implant.analyzers${loop.index}.wrapper">
    </c:otherwise>
    </c:choose>
    <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.
Working...
X