Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 week ago
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 :(
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 ...
}
Last updated on Feb, 6th 2012
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>
Last updated on Feb, 6th 2012
You cannot reply to this thread.