Jquery Ajax using Spring 2.5.6 MVC Controller
I have done an ajax call as below in my jsp -
$(document).ready(function () {
$('#alarmsDetailsWebModel').submit(
function(event) {
$.ajax({
url : "/ratp-ssi-project-web/ui/project/modules/alarmmanagement/alarmdetails",
type : "GET",
dataType:"json",
success : function(data) {
/* data = $.parseJSON(data);
alert(data);
for (i = 0; i < data.responseHTML.length; i++){
alert(data.responseHTML[i]);
} */
},
error : function(xhr, status, error) {
alert(xhr.responseText);
}
});
return false;
});
});
Controller has below code -
@RequestMapping("/project/modules/alarmmanagement/alarmdetails")
public String getAlarmDetails(Model model) {
String responseHTML = "";
alarmsDetailsWebModel adModel = new alarmsDetailsWebModel();
responseHTML = retrieveAlarmsList(adModel); // this returns list of webmodels and is then converted to JSON string using jackson jar.
return responseHTML;
}
i am unable to get the data in jsp. How do i retrieve the data (json string) in the jsp?
PROBLEM STATEMENT / REQUIREMENT -
keep updating a table in jsp without refreshing the page.