我有一個以.json功能,其獲取一些數據,我想用一個<display:table>
顯示它,我該怎麼辦呢如何在顯示中顯示數據:.json函數中的表格?
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>
爲什麼你有'的contentType: 「應用/ JSON的;字符集= UTF-8」,在'GET請求? GET請求中沒有請求主體,因此沒有任何內容類型可以描述。 – Quentin 2014-09-01 08:07:59