Message Boards

How to get nested request object from HttpServletRequest

Brijesh Desai, modified 2 Years ago.

How to get nested request object from HttpServletRequest

Junior Member Posts: 55 Join Date: 10/22/14 Recent Posts

Hello All,

We have nested object in HttpServletRequest, we need to get child request object highlighted in following screenshot.

Please help.

 

Regards, Brijesh

thumbnail
Olaf Kock, modified 2 Years ago.

RE: How to get nested request object from HttpServletRequest

Liferay Legend Posts: 6396 Join Date: 9/23/08 Recent Posts

No, you don't.

This is an implementation detail that could change any time, with any minor update to either Liferay or your appserver.

The follow-up question is: What do you want to have it for? That would be a question that might be answerable. The data (e.g. parameters etc) should be in the request that you already have.

Unless I know more about the underlying problem, this smells like a classic x-y-problem to me.

Brijesh Desai, modified 2 Years ago.

RE: How to get nested request object from HttpServletRequest

Junior Member Posts: 55 Join Date: 10/22/14 Recent Posts

Hi Olaf,

Thanks for details here. Appreciate quick response..!!

We have created custom Spring login portlet in Liferay 6.2 with Jboss.

We are facing a blocker issue with Login after patch deployment, if we remove patch, same custom login portlet works successfully,

Lifeary OOTB login portlet works with and without patch with both condition,

When Investigating, Liferay login have 1 level less in nested request object compared to custom login request object, and due to that dispatcherType value are different, with OOTB login dispatcherType is 2 and with custom login portlet dispatcherType value is 4, in Liferay Patch, We compared source code, and found some code difference in LoginUtil  > login method, in Patch src LoginUtil > login method have check with dispatcherType if 2 and executes some code when patch deployed in debug mode, and with custom login portlet, dispatcherType value comes 4 and it doesn't execute some part of code in debug mode.

we have custom Login portlet and we are calling Liferay services to authenticate users by following code,

 

Any thoughts or directions will really help us.. thanks in advance.

Regards,

Brijesh

thumbnail
Olaf Kock, modified 2 Years ago.

RE: RE: How to get nested request object from HttpServletRequest

Liferay Legend Posts: 6396 Join Date: 9/23/08 Recent Posts

Posting text as image guarantees that it's hard to read. Please don't do that.

There are two different methods that reveal a HttpServlerRequests. I've described both options in the past on stackoverflow. Please check that answer