后端代码:
public void show_main(){
String token
= this.getPara("token");
JSONObject json = new JSONObject();
json.put("token", token);
json.put("resultMap", new
JSONArray());
this.setAttr("loginData", json);·
renderFreeMarker("index.html");
}
前端JSP代码:
<#list loginData.resultMap as jspider>
<li><div
class="photo"><a href="/news/show"><img src="../images/1.jpg"
/></a></div><div class="txt"><a
href=""></a></div></li>
</#list>
报错:
For "#list" list source: Expected a collection or sequence, but this
evaluated to an extended_hash+string (org.json.JSONArray wrapped into
f.e.b.StringModel):
==> loginData.resultMap [in template
"WEB-INF/index.html" at line 228, column 8]