6 Replies Latest reply on Jul 7, 2008 4:30 PM by beyarecords

    Problem getting client IP address: IP address is null

    beyarecords Novice

      Hi,
      I have specified the following factory in my components.xml file:



      <factory auto-create="true" name="remoteAddr" value="#{facesContext.externalContext.request.remoteAddr}"/>



      and in my class I simply specify the following:



              @In String remoteAddr;
              private String userIp = remoteAddr;
      
              @Column(name = "user_ip")
              public String getUserIp() {
                      return this.userIp;
              }
      
              public void setUserIp(String userIp) {
                      this.userIp = userIp;
              }
      



      New records are created without an IP address. What am I overlooking?


      My development platform is:


      Win XP SP1
      JDK 1.6.0_06
      Seam 2.0.3.CR1
      Eclipse 3.3.2 SDK using Jboss Tools 2.1.2.GA




      Many thanks in advance.


      Andrew