Search code examples
jsonweb-servicesrestliferayportlet

Liferay REST web service API



I'm trying to implement REST service in a liferay portlet. Found no way other than using JSON web services in liferay. I don't need to implement web services to interact with the database directly, meaning I dont want to build services to use Json web service. Is there anyway to implement REST web services in a liferay portlet without involving service building, more like a custom web service? Also provide any examples available if possible.
Thanks in advance.


Solution

  • For Spring based portlets, there's an excellent and still valid blog Using RESTFul services with Liferay that describes implementing REST services with Spring MVC controllers and Liferay PortalDelegateServlet.

    Another option might be to handle the REST calls as resource requests (it. to implement a controller with resource mappings - @ResourceMapping).