Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Anupam D D
request.getRemoteAddr() in JSP/PortletRequest
27 de agosto de 2008 15:19
Respuesta

Anupam D D

Ranking: New Member

Mensajes: 7

Fecha de incorporación: 23 de junio de 2008

Mensajes recientes

Does anyone know how I can get the value of the user's IP address. Normally you'd get it using HttpServletRequest.getRemoteAddr()

I tried something like this, which returns null:
javax.servlet.http.HttpServletRequest req1 = (javax.servlet.http.HttpServletRequest) request;
req1.getRemoteUser();

Even better would be to get to remoteAddr in an action where the request object is of type PortletRequest
I tried using PortletRequest.getRemoteUser() but no joy here.

There's another post somewhere as to being able to get it when using Faces but that doesn't help me.


Thanks in advance
Björn Ryding
RE: request.getRemoteAddr() in JSP/PortletRequest
27 de agosto de 2008 15:37
Respuesta

Björn Ryding

Ranking: Liferay Master

Mensajes: 582

Fecha de incorporación: 16 de mayo de 2007

Mensajes recientes

Try:
PortalUtil.getOriginalServletRequest(request).getRemoteAddr()

- Björn