Announcement Announcement Module
No announcement yet.
Binding a Hashset using JSP Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Binding a Hashset using JSP


    I have a Class "RiskIndicator" which has a property HashSet<BBT> bbts (BBT is a self written class).
    I use a SimpleFormController and a JSP form to visualize the Riskindicator as follows:
    <form:form commandName="riskIndicatorType">
    Name: <form:input path="name" />
    	<c:forEach items="${bbts}" var="buildingBlock">
    		<c:out value="${buildingBlock.identityString}"></c:out>
    		<form:checkbox path="bbtypes" value="${}" />
    		<br />
    	<input type="submit" value="Weiter" name="_submit" />
    The problem is, that I don't know, what I have to put in the value in the <form:checkbox/> element. I tried buildingBlock alone and but I get BindingErrors.
    In the form all available BBTs are shown (I put them in the referenceData method in a model to access them in the JSP). Now I want to connect the selected BBTs to my RiskIndicator object, but this doesn't work automatically. I could access the checked values by using the request.getParameterValues(), but is there a more beautiful method to manage this binding?

    thx for helping!