- 注册时间
- 2017-6-12
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 29
- 精华
- 0
- 帖子
- 0

|
前台html代码:
<input id="id" class="mini-combobox" property="editor" readonly="true"
style="width: 100%;" textField="text" valueField="id"
url="/sotc-ec-management-web/query/varietysParams"/>
后台代码:
@RequestMapping(value = "/query/varietysParams")
public String queryParas(HttpServletRequest request,HttpServletResponse response,
@RequestParam Map<String, Object> param,String tablename){
String jsonDatas = "";
StringBuilder sb = new StringBuilder();//构造json
try {
String data = request.getParameter("data");
String parameterCode= StringUtil.toString(param.get("parameterCode"));
HashMap map = new HashMap();
map.put("parameterCode", parameterCode);
List<HashMap> List = parameterService.queryParas(map);
sb.append("[");
for (HashMap hashMap : List) {
sb.append("{id:\""+(String) hashMap.get("itemCategoryType")+"\""+",text: \""+
(String) hashMap.get("itemCategoryTypeName")+"\"}"+",");
}
if (sb.length()>0) {
sb.deleteCharAt(sb.length() - 1);
}
sb.append("]");
} catch (Exception e) {
e.printStackTrace();
}
return sb.toString();//[{id:"**",text:"**"}]
}
页面中一直报:org.thymeleaf.exceptions.TemplateInputException: Error resolving template "[{id:"A02",text: "进口炼焦煤"},{id:"A01",text: "进口铁矿石"}]", template might not exist or might not be accessible by any of the configured Template Resolvers
这该怎么解决? |
|