Loading...
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.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

How to access the Liferay User Details inside the Vaadin Source Code?

Sanjay Das
1 decade ago Mar 19, 2010 10:38am
Henri Sara
1 decade ago Mar 19, 2010 12:25pm
Sanjay Das
1 decade ago Mar 22, 2010 6:59am
Henri Sara
1 decade ago Mar 23, 2010 1:56pm
Chris Elias
1 decade ago Mar 25, 2010 11:06pm

A clean easy that I have implemented is the following

import com.liferay.portal.model.User;
import com.liferay.portal.util.PortalUtil;

public class PortletApplication extends Application implements PortletListener {

@Override
public void handleRenderRequest(RenderRequest request, RenderResponse response) {

User user = null;

try {
user = PortalUtil.getUser(request);
} catch (PortalException ex) {
// error handling
} catch (SystemException ex) {
// error handling
}

setUser(user); // the Vaadin Application USER to liferay's user. Gives your application easy access

// rest of your code
}

// rest of your application goes here
}

Conrado Gutierrez
1 decade ago Apr 27, 2010 7:50pm
Henri Sara
1 decade ago Apr 28, 2010 6:00am
Nicolas Muller
1 decade ago May 10, 2010 10:36am
Henri Sara
1 decade ago May 10, 2010 11:47am
Nicolas Muller
1 decade ago May 11, 2010 8:07am
Ramesh S
6 years ago Apr 21, 2015 10:45am