Hi,
First of all, using the request.getRemoteAddr() from script component will always retrieve the server's IP (because the script will run on server). The only way you can obtain the client's address is using a JSP scriptlet inside the login page template. For example:
<%
out.println("Client's IP address is " + request.getRemoteAddr());
%>
If you want to save the IP in the database (in USER table), I think that a good approach is to create a context parameter (eg. IP_CTX_PARAM) in your model and set it into JSP tags as explained in
https://www.webratio.com/forum/question-details/set-context-parameter?link=oln15x.redirect&nav=45
So, for your particular issue, lets assume that your IP_CTX_PARAM has the ctx1 id. The scriptlet that you should put inside your login page template will be the following:
<% {
String userIPAddress = request.getRemoteAddr()
java.util.Map sessionCtx = (java.util.Map)session.getAttribute(com.webratio.struts.WRGlobals.SESSION_CONTEXT_KEY);
sessionCtx.put("ctx1", userIPAddress ); //ctx1 is the id of the IP_CTX_PARAM
} %>
If the client is connecting through a proxy, this method that I presented will return the IP of the proxy. In this case you can parse the request.getHeader("x-forwarded-for") in order to get the real IP of the client.
Hope that this will solve your problem