java - form options not populating -


in spring mvc app, following code not populating drop down list should:

<form:select path="medication.doseformselected">     <form:option value="-1">select dose form</form:option>     <form:options items="${doseforms}" itemlabel="str" itemvalue="rxaui" /> </form:select> 

here html results above code:

<form:select path="medication.doseformselected">     <form:option value="-1">select dose form</form:option>     <form:options items="[mouthwash, solution, tablet, toothpaste, cream, foam]" itemlabel="str" itemvalue="rxaui" />   </form:select>   

as can see, option items populating list invisible in user's browser unless view source.

how can change code populate drop down list correctly?

for reference, here complete list of taglibs referenced @ top of jsp:

<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="datatables" uri="http://github.com/dandelion/datatables" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %> 

what else need post see problem?

no, spring's form tag library produces html <form> elements, if

<form:select path="medication.doseformselected">     <form:option value="-1">select dose form</form:option>     <form:options items="[mouthwash, solution, tablet, toothpaste, cream, foam]" itemlabel="str" itemvalue="rxaui" />   </form:select>  

appears in html source see in browser, means jsp servlet did not use form tag library render , wrote response directly (after resolving el).

you seem missing

<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 

also, seem have number of duplicate tag libraries declared.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -