Results 1 to 1 of 1

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

  1. #1
    Join Date
    Apr 2012
    Posts
    10

    Exclamation 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 at 10:28 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •