1 Reply Latest reply on Jul 22, 2008 4:12 PM by zergspirit

    No captcha image

    zergspirit

      Hi!
      I can't get the captcha to work.
      I followed the short help about it in theSeam docs, but still, no image appears.
      I added


      <servlet>
      
          <servlet-name>Seam Resource Servlet</servlet-name>
      
          <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
      
      </servlet>
      
      
      
      <servlet-mapping>
      
          <servlet-name>Seam Resource Servlet</servlet-name>
      
          <url-pattern>/seam/resource/*</url-pattern>
      
      </servlet-mapping>


      To my web.xml.
      Then put:


      <h:graphicImage value="/seam/resource/captcha"/>
      
      <h:inputText id="verifyCaptcha" value="#{captcha.response}" required="true">
      
         <s:validate />
      
      </h:inputText>
      
      <h:message for="verifyCaptcha"/>
      


      Into a form and a jsf page, but no image is shown.
      If I had a commandButton to simply submit the form, then the message says it's an incorrect answer.



      I tryed to override Captcha component exactly the same way it's done in the  docs, adding a Sysout in the init() method, it's not called.
      If I subimt the form using a h:commandButton, it says the answer is incorrect, although I enter what I set as correct answer using setCorrectResponse method.


      Really don't see what I'm doing wrong there, since it's pretty simple.


        • 1. Re: No captcha image
          zergspirit

          Turns out the 'custom captcha class' has to be named org.jboss.seam.captcha.captcha and not org.jboss.seam.captcha as stated in the docs... but still, it's not working.