What is the difference between these 2? I found few results on google nothing conclusive.
Here is a follow up question:
Say I create spring mvc web app ann
Web Service uses ServletContainer class which is again a Servlet class, which handles the request in clean and structured way. The REST stands for REpresentational STateless Protocol. Here the request won't store any data.
The REST Web Service supports HTTP methods
We can map any number of URLs to Web Service class which can have any type of HTTP methods.
On other hand, there can be only 1 URL mapping can be done for each servlet. Though the end requirement can be achieved with the help of request parameter conditions, but using servlet nowadays won't provide clean way.
In webservice we can define URL path at Class level as well as Method level, which allows us to code in more structured way.