我有一个 servlet,它使用 doGet 方法接受两个输入参数并进行一些处理。如何将 servlet 制作为 RESTful Web 服务?
提前致谢
我有一个 servlet,它使用 doGet 方法接受两个输入参数并进行一些处理。如何将 servlet 制作为 RESTful Web 服务?
提前致谢
It is already a REST service. Most REST service Java libraries are based on servlets. Now it depends on your "mapping" of your "resources":
Servlets mostly process this kind of requests with query parameters:
http://host:port/context/endPoint?a=100%b=test
This is considered a "correct" REST resource end point:
http://host:port/context/endPoint/100/test