Hi,
I have a requirement to find the User Name and the IP Address of the client for each EJB method call. Using EJB Context object we can get the User name but how to get the IP Address of EJB Client. We are using IBM Websphere 5.2 Application Server.
Can you please let me know the solution. Thanks in advance.
Best Regards-
Siva
-
How to find IP Address of EJB Client (3 messages)
- Posted by: siva subrahmanyam
- Posted on: April 11 2006 01:06 EDT
Threaded Messages (3)
- How to find IP Address of EJB Client by Debashish Ghosh on April 14 2006 16:56 EDT
- How to find IP Address of EJB Client by Niranjan Sarvi on April 19 2006 14:46 EDT
- Re: How to find IP Address of EJB Client by Gerson Magalh?es on July 31 2006 16:58 EDT
-
How to find IP Address of EJB Client[ Go to top ]
- Posted by: Debashish Ghosh
- Posted on: April 14 2006 16:56 EDT
- in response to siva subrahmanyam
Hi,
Assuming that all the calls to your EJBs is from a controller servlet (which is the most common case unless u have a thick client making IIOP calls) u can track the IP address of the clients using ServletRequest.getRemoteAddr().Hope this answers your question.
Cheers
Debashish -
How to find IP Address of EJB Client[ Go to top ]
- Posted by: Niranjan Sarvi
- Posted on: April 19 2006 14:46 EDT
- in response to Debashish Ghosh
Hi Siva,
Assuming that, servlet is the only client for the EJB,
you can do that using servlets request object and getting the client specific requirements.
If a Java or EJBs/MDBs are the client for the EJB method calls, you will not be able to get the IP address.
Having said, for each type of client(Java/EJB/MDB/ other components) that calls the EJB, you have to get information from the end clients and adopt a strategy to send end client information to EJB methods.
Above is the workaround to solve the generic problem.
Thanks
Niranjan -
Re: How to find IP Address of EJB Client[ Go to top ]
- Posted by: Gerson Magalh?es
- Posted on: July 31 2006 16:58 EDT
- in response to siva subrahmanyam
Try to use the following method: java.rmi.server.RemoteServer.getClientHost().