on ‎2014 Jan 20 8:08 AM
Dear All,
I have a situation in my Webdynpro Java Application where I have to capture the IP address of the end user's PC. I use the below code for capturing IP:
IWDRequest req = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
String ipAddress = req.getClientHostName();
The problem is, the code is working perfectly in Quality system, but not in Production system. The IP which is captured in the Production system is the Portal IP itself. Is the problem has to do with some Network settings or the code has to be changed?
Request clarification before answering.
Can you please try following code.
You may not get the real client IP if a the client is behind a proxy, you will get the IP of the proxy and not the client. However, the proxy may include the requesting client IP in a special HTTP header.
HttpServletRequest req=(HttpServletRequest)TaskBinder.getcurrentTask().getProtocolAdapter().getRequestObjectInternal().getProtocolRequest();
req.getHeader("X-Forwarded_For);
Thanks,
Patralekha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.