Liferay Session in Vaadin 7

How can I get the Liferay Session in Vaadin 7? With Vaadin 6 I got it from the PortletRequest variable by overriding onRequestStart.

Thanks

Does anybody have any information on this? Thanks

Folks at Vaadin, surely you would have a suggestion for me here. I can’t imagine that guys didnt have to deal with this situation somewhere…

The PortletSession?

One option is to call VaadinSession.getCurrent(), check that the returned session is a WrappedPortletSession and call its getPortletSession().
Another option is to access the PortletRequest e.g. in a PortletListener.

Thank you for replying Henri,

I mean HttpServletRequest session. The main Liferay session, so I can access logged in user info, etc…

From what I have read so far is that Vaadin 7 does not implement PortletListener interface anymore, therefore I can’t get the PortletRequest. Is that correct?

In Vaadin 6 I would get the HttpServletRequest from the PortletRequest…

Anymore ideas Henri?

Can anybody please help me with this issue?

Hi, I have the same problem… I need to read an object stored inside the HttpSession in Liferay.

This is the working code i use inside a GenericPortlet:
HttpSession portletSession = PortalUtil.getHttpServletRequest(myPortletRequest).getSession();

Have you found any solution?
I googled A LOT but I didn’t find any example or tutorial that I can use, is this even possibile using Vaadin 7 or am I forced to use Vaadin 6?

Thank you :slight_smile:

I just ran into this as well and have not found a Vaadin 7 approach to obtain the HttpServletRequest.

Once you find the information that a VaadinRequest is both VaadinPortletRequest and VaadinServletRequest, you can retrieve PortletRequest and HttpServletRequest as so:

        VaadinPortletRequest vprRequest = (VaadinPortletRequest) request;
        PortletRequest pRequest = vprRequest.getPortletRequest();
        
        VaadinServletRequest vsRequest = (VaadinServletRequest)request;
        HttpServletRequest hsRequest = vsRequest.getHttpServletRequest();