on ‎2023 Jun 21 6:30 PM
Greetings to all, I am developing a UI5 application using Spring boot application as backend and connected to SAP HANA cloud Database. I am getting CORS Error: No "Access-Control-Allow-Origin" header present on request resource, and in network tab with 200 status code.

My backend application setup- I created Spring Starter Project version 2.5.5 using JavaSE 1.8 . Created a REST API in Spring boot application controller which I am using in ajax call.

For connecting Spring boot app to HANA cloud database I provided credential in application properties and added the ngdbc dependency in pom.xml, after I deployed the application in Cloud Foundry environment using following manifest.yml. Rest API after Cloud Foundry Deployment working properly fine.

My UI5 Application setup: In UI5 application I fetch Rest API using ajax call.

I google the error and I applied some changes in backend API like using @CrossOrigin in API level and controller level both and also tried at ajax level in UI5 Application can be seen in above code in commented part.

And also tried to enable CORS using globally, declare in Bean Class like using allowedOrigins(), allowedHeaders(), addMapping("/**"), exposedHeaders() etc methods but nothing works.
Please guide me for this and also suggest that how can I use/consume REST API in SAP BTP.
Thanks
Request clarification before answering.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.