BAEL-102 - Spring with JSON-P

This commit is contained in:
slavisa-baeldung 2016-08-01 00:14:00 +02:00
parent a9b95d326b
commit 1972b45a5b

View File

@ -1,3 +1,5 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
@ -46,25 +48,19 @@
}); });
function getCompanyData(data) { function getCompanyData(data) {
document.write("<b>ID:</b> "+data.id+"<br/>"); $("#response").append("<b>ID:</b> "+data.id+"<br/>");
document.write("<b>NAME:</b> "+data.name+"<br/>"); $("#response").append("<b>NAME:</b> "+data.name+"<br/>");
document.write("<br/>"); $("#response").append("<br/>");
} }
</script> </script>
</head> </head>
<body> <body>
<!-- Using REST URL-->
<button id="REST-button">Test REST JSON-P!</button>
<div id="infoREST"></div>
<!--Using @ResponseBody --> <!--Using @ResponseBody -->
<button id="ResponseBody-button">Test ResponseBody JSON-P!</button> <button id="ResponseBody-button">Send AJAX JSON-P request!</button>
<div id="infoResponseBody"></div>
<div id="response"></div>
<!--Using ResponseEntity -->
<button id="ResponseEntity-button">Test ResponseEntity JSON-P!</button>
<div id="ResponseEntity"></div>
</body> </body>
</html> </html>