On Jul 31, 2008, at 2:15 AM, Ron McNulty wrote:
Hi David
Just to clarify, getRemoteAddress() returns the expected client IP
address
in the servlet API, but null in the portlet API. This is in
accordance with
the JSR 168 standard (and a right PIA if you ask me)...
If someone can tell me how to get the client IP in the portlet API
(Needs to
work on Jetspeed 2 and IBM Portal Server), I would be very happy.
The client IP? Oh I thought your question was clearly asking for the
*server* IP. Sorry about my previous answer being a complete waste of
time.
Well that is a tricky question. I can answer it for Jetspeed, but not
for the other portal. I don't think there is a generic way to do this
so maybe you could abstract out a function to handle both?
With Jetspeed, if you are in a say a JSP, try:
<%
JetspeedDesktopContext desktop =
(JetspeedDesktopContext
)request.getAttribute(JetspeedDesktopContext.DESKTOP_ATTRIBUTE);
RequestContext requestContext =
(RequestContext)request.getAttribute(RequestContext.REQUEST_PORTALENV);
HttpServletRequest servletRequest = requestContext.getRequest();
String remoteHost = servletRequest.getRemoteHost();
%>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]