2 Replies Latest reply on Oct 18, 2007 2:33 AM by Shane Bryzak

    seam remoting - can't get a string value

    CUGAT Chloe Newbie

      I use jboss-4.0.5.GA and jboss-seam-1.2.1.GA.
      I use a remoting methode to verify a recaptcha code.
      I have to give IP address for getting this verification :

      ReCaptchaResponse reCaptchaResponse = captcha.checkAnswer(IpAddress, challenge, response);

      In order to get this IP address I use :

      But this code does not work in remote fonction because it use servlet !
      That's why I decide to get this value at the begining of my conversation and set it in a string and after use this String in my remote function but the string value is null !
      public class SignUpManagerBean implements SignUpManagerLocal {
       private String remoteAddress;
       public void beginSignup(){
       mb=new Mb();
       remoteAddress = ((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getRemoteAddr();
       * Verification captcha
       public boolean verifyCaptcha(String challenge, String response){
       //Create an object recaptcha
       ReCaptcha captcha = ReCaptchaFactory.newReCaptcha("6Ld8gwAAAAAAAOS89isUAzfokP4FnY4_EBWb3gjM", "6Ld8gwAAAAAAAEw7vRs4DXQ6qb5BlEG6VkrpH8F4", false);
       //Check the answer of the user
       ReCaptchaResponse reCaptchaResponse = captcha.checkAnswer(this.remoteAddress, challenge, response);
       //if the answer is valid
       if (reCaptchaResponse.isValid()) {
       return true;
       else {
       return false;

      The result of
      in the beginsignup function show me the good value of my IP address but when I call it from the remote function the String value is "Null" !

      I add this code for more details :
      public interface SignUpManagerLocal extends SignUpManager {
       public boolean verifyCaptcha(String challenge, String response);
       public void destroy ();