Add these two imports:
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
And then pull it up like so:
HttpServletRequest request = ServletActionContext.getRequest();
String ip = request.getRemoteAddr();
Thanx man...It really helped me..:)
ReplyDelete