I have JSP page that should print JSON file. Here is the directive
<%@ page contentType="application/json;" pageEncoding="UTF-8"%>
and one line of the code: out.println(result); //Results is JSON string from DB
But every time when I call the jsp page the result is a JSP file instead of application/json
And then I try to load JSON from the JSP:
.ajax({
url: url_res,
dataType: 'json',
contentType: 'application/json',
success: function(value, textStatus, jqXHR) {
alert(textStatus+" "+value+" "+jqXHR);
And always I get NULL in the vale var.
PLS help, i need this for my faculty project..
If you directly put the jsp page in browser and the returned source code is plain json, then your jsp page is just fine.
try to testing the data in json by alert(textStatus+" "+value.something+" "+jqXHR);