I use ubuntu 12.04, liferay version 6.0.1, open jdk 6 on my system. I tried to get remote ip and location in java. To do this, I found Host Ip , with which we can get the apache http get method. I successfully executed this on my local system. But in fact, the liferay portlet is not running, and it is difficult to find an error, since several instances work simultaneously. The server is based on Windows. I use this method in doView () of the MVC portlet to get ip
com.liferay.portal.util.PortalUtil.getHttpServletRequest(renderRequest).getRemoteAddr()
source
share