Vlad Dekhanov
Vlad Dekhanov

Reputation: 1084

How to get PortletRequest in the JSON WebService in Liferay?

This question originates due to I need to use LoginUtil.login() in my Liferay portlet. Well, to affect the login method from LoginUtil I should have HttpServletRequest, PortletRequest or something similar.

Could you explain me how I can get these objects in the JSON WS layer? Or probably there are another ways to practice digest authentication in Liferay 6.2?

Upvotes: 0

Views: 1155

Answers (1)

Ben VonDerHaar
Ben VonDerHaar

Reputation: 281

The Web Services layer in Liferay is actually quite separate from the request handling for Service Builder-generated REST calls. Liferay provides you with some information in the XXXServiceImpl class, notably the user information through this.getUser(), but you will not be able to access the actual HTTP request from here. If you need the raw request and have control over the URL you are calling, I would recommend creating a servlet (see Alain Dreese's comments here).

Upvotes: 1

Related Questions