Show TOC Start of Content Area

Background documentation Obtaining the Remote Host Address  Locate the document in its SAP Library structure

You can use methods of the ServletRequest object to obtain the address of the remote server you communicate with. One of the methods is getRemoteAddr(), which returns the IP address of the server, and the other is getRemoteHost(), which must return the server’s fully qualified host name. However, the J2EE Engine’s Web Container is configured by default in a way that the getRemoteHost() method also returns the IP address of the remote server (that is, it does not attempt to resolve it to the corresponding host name).

The behavior of the getRemoteHost() is controlled by the ResolveHostNames property of the Web Container Service. If you set this property to true, then the J2EE Engine attempts to resolve the remote server’s IP address so that the above method returns the corresponding fully qualified host name.

Note

Keep in mind that in complex network environments (using firewalls, proxy servers, and other), resolving the remote server’s address is not guaranteed. For example, if you are running an ABAP+Java installation of the Web AS, the J2EE Engine will be running behind the Internet Communication Manager (ICM), which is usually configured in a way that will not enable the servers behind it to access the Internet. This means that the remote server’s address cannot be resolved.

Also, resolving the IP address may be a slow process (depending on your network setup), which can result in reduced performance of the Web application.

 

See also:

 

Web Container Service in the Reference Manual

End of Content Area