vendredi 17 avril 2015

HDIV error in forEach inside form select

I'm having trouble trying to implement form:select in HDIV. Here's my code in the JSP which renders the selector and options:





<form:form
modelAttribute="staffPosition"
method="post"
action="${contextPath}/project/assign/staff">
<td>
<form:select class="form-control" path="staffID">
<c:forEach items="${staffList}" var="staff">
<c:set var="staffName" value="${staff.prefix} ${staff.firstName} ${staff.middleName} ${staff.lastName} ${staff.suffix}"/>
<form:option value="${staff.id}" label="${staffName}"/>
</c:forEach>
</form:select>
</td>
<td>
&nbsp;
</td>
<td>
<form:input placeholder="Example: Project Manager, Leader, etc..."
type="text"
class="form-control"
path="position"/>
</td>
<td>
&nbsp;
</td>
<td>
<button class="btn btn-default btn-flat btn-sm">Assign</button>
</td>
</form:form>



After I click assign and initiate the action, the request would arrive in the Controller with the correct ID of the selected form:option.





public String assignStaff(
@ModelAttribute(ATTR_STAFF_POSITION) StaffAssignmentBean staffAssignment) {



However, when I inspected the console, there was an error: INVALID_CONFIDENTIAL_VALUE;/pmsys/project/assign/staff;staffID;27;[27, 28, 29, 30, 31, 32, 41];127.0.0.1;127.0.0.1;root


When I tried to trace the line of code which spits out the error: org.hdiv.filter.ValidatorHelperRequest:948


There was an inconsistency with the originalValue and the parameter value when this condition was evaluated: if (!m.matches() || (Integer.valueOf(value).intValue() >= stateValues.size())) {


originalValue = [27, 28, 29, 30, 31, 32, 41]


value = 27 (This is the ID number of the form:option which I selected in the JSP)


Does anyone have any solution to this problem? Could this be a bug in HDIV?


Note: This problem does not occur if I do not have a <c:forEach inside <form:select.


Aucun commentaire:

Enregistrer un commentaire