Obtain client IP address using web script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2009 04:41 PM
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2009 02:23 AM
Sure, but you have to use Java as your controller. Alfresco's WebScriptRequest wraps around a standard Java HttpServletRequest, which holds the IP adress of the requester.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2011 10:39 AM
Hello,
I was wondering if this changed or not.
With my WebScriptRequest I couldn't find a way to get the IP address or to retrieve a HttpServletRequest Object where I could apply getRemoteAddr().
And I was wandering, is the java-backed webscript the only way to do it or could I just expose some java object to javascript that would enable me to get the client IP?
Thanks,
I was wondering if this changed or not.
With my WebScriptRequest I couldn't find a way to get the IP address or to retrieve a HttpServletRequest Object where I could apply getRemoteAddr().
And I was wandering, is the java-backed webscript the only way to do it or could I just expose some java object to javascript that would enable me to get the client IP?
Thanks,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2011 04:57 AM
Got it, all we need is a cast:
if (req instanceof WebScriptServletRequest) { HttpServletRequest r = ((WebScriptServletRequest) req).getHttpServletRequest(); String sourceIp = r.getRemoteAddr();}

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2013 12:46 AM
How to track IP address of Client while auditing in alfresco?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2014 04:47 AM
This is not working for alfresco 4.2x.
Any idea what is working solution ?
Any idea what is working solution ?
