Foros de discusión

Accessing liferay api from a JSP

Vasanth Jayabalan, modificado hace 12 años.

Accessing liferay api from a JSP

New Member Mensajes: 24 Fecha de incorporación: 25/02/11 Mensajes recientes
Hello,

Is it possible to access the liferay API from outside the portlet container, like from a standalone JSP? I want to get the liferay logged in user's credentials from a standalone JSP, but couldn't think of a good way to do this. I am not going through any portlets. Any help would be appreciated.

thanks,
Vasanth
thumbnail
Ronak Patel, modificado hace 12 años.

RE: Accessing liferay api from a JSP

New Member Mensajes: 19 Fecha de incorporación: 20/01/10 Mensajes recientes
Hi Vasanth,
Do you want to get the details of all currently logged in users for some monitoring / audit trail functionality? because there can be many concurrent session in 1 server at any time.
So please provide more information on the requirement.

Thanks,
Ronak
thumbnail
Hitoshi Ozawa, modificado hace 12 años.

RE: Accessing liferay api from a JSP

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
If your question if about accessing json, rmi, or web service from jsp, it's probably better to ask in some jsp forum at some other numerous
java sites.
Vasanth Jayabalan, modificado hace 12 años.

RE: Accessing liferay api from a JSP

New Member Mensajes: 24 Fecha de incorporación: 25/02/11 Mensajes recientes
Nope...that's not what my question means. I want to know if I can access the liferay objects like ThemeDisplay, User, etc. (can't think of more now emoticon). I am trying to redirect the default landing page from /web/guest/home to another JSP. I want to access the logged in user's roles and permissions from this redirected JSP. However I am unable to do so. The JSP doesn't recognize the portlet objects created using the Theme and Portlet tag libraries. This makes sense because the JSP could be running in a totally different application (different context) and not know anything about liferay. So I was looking for some static liferay methods to access liferay specific information from the JSP. I came across some great service classes like UserLocalServiceImpl and RoleServiceImpl that seem to solve my problem.