hashmap - Spring mvc form:select path is custom map in model attribute -
how bind map property of model , send selected value controller?
i able populate drop down on submitting form getting error 400 - bad request.
mymodel.java:
public class mymodel{ private map<mysubmodel, string> submodel = new hashmap<mysubmodel, string>(); private submodel submodelsearched; }
submodel.java:
public class submodel{ public string id; public string name; }
jsp:
<form:form action="/mysearch" modelattribute="mymodel" method="post"> <form:select path="submodelsearched"> <form:options items="${mymodel.submodel}/> </form:select> ..... </form:form>
Comments
Post a Comment