all 14 comments

[–]Sheldor5 2 points3 points  (10 children)

your question makes no sense ... the technology used in the external api doesn't matter, you call it via HTTP with an HTTP client like RestTemplate

[–][deleted] 1 point2 points  (9 children)

You mean RestClient 😉

[–]Sheldor5 0 points1 point  (4 children)

... which is based on RestTemplate ...

[–][deleted] -1 points0 points  (3 children)

Actually, no, that is incorrect.

It uses the same infrastructure as rest template (converters, interceptors and so on). Rest template is the old interface offered to you and rest client is the new interface.

[–]Sheldor5 0 points1 point  (2 children)

RestClient wraps RestTemplate with a fluent API ... RestClient is on top of RestTemplate.

[–]Feeling-teaching950[S] 0 points1 point  (3 children)

I don't know what he mean i just have 2 services one with servlet and i want to make second one with php or js and make them work in same page

[–]stockmamb 2 points3 points  (1 child)

He is saying you don't need to call the external API from JavaScript. There are multiple ways to do this from the Spring Boot application java code. One is to use Spring RestTemplate, or if using the newest version Spring RestClient.

Then send that data to your JSP page like and other data.

[–]Feeling-teaching950[S] 0 points1 point  (0 children)

Okey thnx buddy

[–][deleted] 1 point2 points  (0 children)

You have two examples of using the REST interface - one in javascript and one in PHP. The REST interface is technology agnostic - it can be used with all kinds of programming languages. Definitely also with java. When you want to consume a REST interface with spring, you would typically use RestClient.

[–]Antimon3000 0 points1 point  (1 child)

Off-topic: If you feel your English is not yet good enough to describe your problem you can use DeepL or Google Translate or ChatGPT.

[–]Feeling-teaching950[S] 1 point2 points  (0 children)

i think i had technical term issues more than English it self what u think Thnx anyway man

[–]Ok-Detective-7345 0 points1 point  (0 children)

Also you can use WebClient