<td > 類別 </td> <td colspan="1"> <input class="mini-combobox" name="typeId" required="true" url="/dictEntry.do? method=getDictEntryByDictTypeId&dictTypeId=YW_CUSTOMER_TYPE" textField="dictName" valueField="dictId"/> </td> <td >
controllerhtml
public ModelAndView getDictEntryByDictTypeId(HttpServletRequest request, HttpServletResponse response) { String dictTypeId = request.getParameter("dictTypeId"); List<DictEntry> list = dictEntryManager .getDictEntryByDictTypeId(dictTypeId); this.renderText(response, JSONArray.fromObject(list).toString()); return null; }
managerjava
public List<DictEntry> getDictEntryByDictTypeId(String dictTypeId) { Criteria criteria = this.getCriteria(); criteria.add(Restrictions.eq("dictTypeId", dictTypeId)); criteria.addOrder(Order.asc("dictId")); return criteria.list(); }