页面下拉框显示值,存入数据库的是id

来源:互联网 发布:vb安装win10 编辑:程序博客网 时间:2024/05/29 08:46

        jsp  

              <td>

                    <strong>名称</strong>
                     <form:select path="priceId" name="priceId"  class="input-medium" style="width: 130px;" >
                        <form:option value=""><span>请选择</span></form:option>
                        <c:forEach items="${priceVoList}" var="item">
                            <form:option value="${item.priceId}"><span>${item.catalogPriceName}</span></form:option>
                        </c:forEach>
                    </form:select>  

             </td>


controller层

       //查询名称
        CataloguePriceVo priceVo = new CataloguePriceVo();
        priceVo.setCompanyId(companyId);
        List<CataloguePriceVo> priceVoList = contractManageService.findPriceNameList(priceVo);
        model.addAttribute("priceVoList", priceVoList);


阅读全文
0 0