【发布时间】:2014-09-01 08:01:33
【问题描述】:
我有一个 .json 函数,它检索一些数据,我想用 <display:table> 显示它,我该怎么做
Alerta.js
function loadAlertaCitas(){
$.ajax({
type: "GET",
url: contextpath+"/alerta/cargaAlertas.json",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
listaAlertas = data;
}
});
}
Alerta.jsp
<display:table name="listaAlertas" id="alertas"
defaultorder="descending" requestURI="/other/listaAlertas" pagesize="12"
class="table table-striped table-condensed">
<display:column property="fechaalta" titleKey="label.fechaAlta"
sortable="true" class="ancho90" />
</display:table>
【问题讨论】:
-
为什么在 GET 请求中有
contentType: "application/json; charset=utf-8",? GET 请求中没有请求正文,因此没有什么可以描述其内容类型。
标签: javascript json spring-mvc