mysql - Spring MVC-showing object values in jsp -
i using spring mvc,mysql, jdbctemplate in project.
when fetching data db using drop down list box in jsp page
instead of showing number upto 0-9. showing encrypted values.
the data type i've passed here int.
my controller class:
@requestmapping(value="/index.htm", method = requestmethod.get) public string executesecurity(modelmap model, principal principal,@modelattribute searchfiller searchfiller) { list<searchfiller> adultslist=searchflightdao.adultslist(); model.addobject("adultslist", adultslist); string name = principal.getname(); model.addattribute("author", name); return "welcome"; }
my part of jsp page:
<form:form action="index" method="get" modelattribute="searchfiller">
. . .
<tr> <td>adults</td> <td><form:select path="adults"> <form:option value="none" label="--- select ---" /> <form:options items="${adultslist}" /> </form:select> </td> <td><form:errors path="adults" cssclass="error" /></td> </tr>
searchfiller.java
private int adults; getters , setters
is whether hashcode or encrypted form?? right answer gets appreciated.
so here answer:
<tr> <td>adults</td> <td><form:select path="adults"> <form:option value="none" label="--- select ---" /> <form:options items="${adultslist}" itemvalue="<propertyname_of_searchfiller_pojo_you_want_to_pass_set_as_value_of_option>" itemlabel="<propertyname_of_searchfiller_pojo_you_want_to_show_as_option_on_browser>" /> </form:select> </td> <td><form:errors path="adults" cssclass="error" /></td> </tr>
Comments
Post a Comment