reset password
Author Message
abhishek_sharma
Posts: 79
Posted 10:35 Sep 10, 2012 |

Add User Form (addUser.jsp)

                <form:select path="roles" id="access">
                    <c:forEach var="role" items="${roles}">
                        <form:option value="${role.id}">${role.name}</form:option>
                    </c:forEach>
                </form:select>

How can I add roles to User I used path="roles.id" . On the other hand when

In one model class Company I have

    @ManyToOne
    @JoinColumn(name = "category_id")
    private Category category;

and           <label for="category">
                    <form:select path="category.id">
                        <c:forEach var="category" items="${categories}">
                        <form:option value="${category.id}">${category.categoryName}</form:option>
                        </c:forEach>
                    </form:select>
                </label>

is working. So I guess since I have roles as Set in User which may b the reason its not workin

This is the error

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'user' on field 'roles': rejected value [15]; codes [typeMismatch.user.roles,typeMismatch.roles,typeMismatch.java.util.List,typeMismatch]; 
abhishek_sharma
Posts: 79
Posted 18:03 Sep 10, 2012 |

Solved ... I need to declare @init