Xóa bài viết
Bạn có chắc chắn muốn xóa bài viết này không ?
Xóa bình luận
Bạn có chắc chắn muốn xóa bình luận này không ?
Kotlin – SpringBoot + Jquery JsonP for requests to cross domain
Kotlin – SpringBoot + Jquery JsonP for requests to cross domain
In the post, JavaSampleApproach will show you how to use JQuery JsonP Request to Kotlin SpringBoot server without worrying about cross-domain issues.
I. Technologies
- Kotlin 1.2
– Java 1.8
– Maven 3.6.1
– Spring Tool Suite – Version 3.9.0.RELEASE
– Bootstrap
– Spring Boot – 1.5.10.RELEASE
II. Jquery JsonP and Kotlin SpringBoot
JSONP is a solution to resolve cross-domain issues which uses script tag instead XMLHttpRequest object. With JQuery, we can use it as below:
$.ajax({
type : "GET",
url : "http://localhost:9000/api/customer/all",
// The callback parameter
jsonp: "jsaJsonpCallback",
// Tell jQuery that we're expecting JSON-P
dataType: "jsonp",
success: function(result){
// do something here
},
error : function(e) {
// do something here
}
});
To support JSON-P with SpringBoot RestAPI, we use AbstractJsonpResponseBodyAdvice
by Kotlin language:
More at:
Kotlin – SpringBoot + Jquery JsonP for requests to cross domain
Bình luận

{{ comment.user.name }}
Bỏ hay
Hay

Cùng một tác giả

1
0
Tutorial Link: (Link) (Ảnh) Django is a Pythonbased free and opensource web framework that follows the modeltemplateview architectural pattern. A...

1
0
https://loizenai.com/angular11nodejspostgresqlcrudexample/ Angular 11 Node.js PostgreSQL Crud Example (Ảnh) Tutorial: “Angular 11 Node.js Postg...

1
0
Angular Spring Boot jwt Authentication Example Github https://loizenai.com/angularspringbootjwt/ (Ảnh) Tutorial: ” Angular Spring Boot jwt Authe...
Bài viết liên quan

0
0
https://grokonez.com/kotlin/kotlinreadwritecsvfileexample How to read/write CSV file in Kotlin In this tutorial, we're gonna look at examples tha...

0
0
Kotlin Spring Boot + Angular 6 CRUD HttpClient + MySQL example | Spring Data JPA + REST APIs example
https://grokonez.com/frontend/angular/angular6/kotlinspringbootangular6crudhttpclientmysqlexamplespringdatajparestapisexample Kotlin Spring Boot +...