Obtaining IP Address of Client

244 views
Skip to first unread message

I.Pe.

unread,
Dec 21, 2007, 6:24:32 PM12/21/07
to Google Web Toolkit
Is there a way to get a Client's IP address without using any client-
side javascript (this may result in 192.168...)?

I'm using GWT 1.4 with intents to eventually deploy on JBoss.

Cheers!
I. Pe.

Peter Blazejewicz

unread,
Dec 21, 2007, 6:38:44 PM12/21/07
to Google Web Toolkit
hi,
isn't it standard api in Servlet specification? (to get remote address
+ remote host),
on contrary: javascript cannot read local IP in default browsers
sandbox,
It could read that but when running in standalone browsers
implementations like Google Gadgets or OSX Widgets via extensions,

regards,
Peter

I.Pe.

unread,
Dec 23, 2007, 11:20:04 AM12/23/07
to Google Web Toolkit
How do I get access to the instance of the
javax.servlet.ServletRequest or javax.servlet.http.HttpServletRequest
object from an instance of my class that extends
com.google.gwt.user.server.rpc.RemoteServiceServlet to obtain the IP
address?

Cheers!
I.Pe.

On Dec 21, 6:38 pm, Peter Blazejewicz <peter.blazejew...@gmail.com>
wrote:

Reinier Zwitserloot

unread,
Dec 23, 2007, 8:08:26 PM12/23/07
to Google Web Toolkit
Try playing with getThreadLocalRequest() which is a static method...
somewhere in the servlet tree.
Reply all
Reply to author
Forward
0 new messages