Liferay Portlet - How to get a httpHeader?

Hey Guys,

I got this Liferay Vaadin portlet application.
My main class implements the “com.vaadin.terminal.gwt.server.PortletApplicationContext2.PortletListener” interface.
As such I have the public void handleRenderRequest(RenderRequest request, RenderResponse response, Window window) {} method.

Within this method I need to get a hold of a httpHeader.
Anyone who can give me a hand with this? I’m completely at a loss :frowning:

some code:


import com.vaadin.terminal.gwt.server.PortletApplicationContext2.PortletListener;

public class Mainapp extends Application implements PortletListener {
            … non relevant code ...
            public void handleRenderRequest(RenderRequest request, RenderResponse response, Window window) {
            // This is where I need the httpHeader
            }
            … non relevant code ...
}

Solution I used:


import com.vaadin.terminal.gwt.server.PortletApplicationContext2.PortletListener;
import com.liferay.portal.util.PortalUtil;

public class Mainapp extends Application implements PortletListener {
            … non relevant code ...
            public void handleRenderRequest(RenderRequest request, RenderResponse response, Window window) {
              HttpServletRequest httpServletRequest = PortalUtil.getHttpServletRequest(request);
			  httpServletRequest.getHeader("[HEADER_NAME]
"));
            }
            … non relevant code ...
}

PortalUtil can be found in the com.liferay.portal-service jar


<dependency>
  <groupId>com.liferay.portal</groupId>
  <artifactId>portal-service</artifactId>
  <version>6.1.0</version>
</dependency>