Nowadays i am learning REST but i couldn't understand its way of usage. Probably this is perfectly easy question but since i have lack of knowledge about concepts i am totally confused.
Let say i have a simple Spring MVC
application and i run localhost:8080/greeting/?id=1 and it shows my greeting.html page and some data from my database. So far so good.
But when i change my @Controller
to @RestController
and call localhost:8080/greeting/1 i get a json as following {"id":1,"content":"Hello, World!"}
. I understand this is normal because this is a response of rest service.
But how to use it in my greeting.html? i mean what is the concept to map this data to my html page?
Thanks in advance
Altan