Captcha Not Updating Without New Session
accountclosed Jul 21, 2008 9:28 PMI am using Seam 2.0.2 SP1, Tomcat 6, Ubuntu 7.10 and am trying to use the Seam captcha within a natural conversation. Problem is the captcha does not reload in the following conditions:
- Invalid input
- New natural conversation started
Only if I clear the browser's cache will the captcha reload with a different image/value which indicates that the session has been cleared from the browser. Anyone know how I can make this work properly (i.e., reload an image for each invalid response and new conversation)?
My form has:
<rich:panel style="width:250px;">
<f:facet name="header">
<h:outputText value="Answer the following question to continue:"></h:outputText>
</f:facet>
<h:panelGrid columns="2">
<h:outputText value="Captcha:"/>
<h:graphicImage value="/seam/resource/captcha"/>
<h:outputText value="Result: "/>
<h:inputText id="verifyCaptcha" value="#{captcha.response}" required="true"
styleClass="text">
<s:validate />
</h:inputText>
  <h:message for="verifyCaptcha" styleClass="text"/>
<h:outputText value="Click: "/>
<h:commandButton value="REGISTER" action="#{memberreg.start}" styleClass="submit">
<s:conversationName value="regmem"/>
<s:conversationPropagation type="join"/>
</h:commandButton>
</h:panelGrid>
</rich:panel>
My pages.xml file has:
<pages xmlns="http://jboss.com/products/seam/pages"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
no-conversation-view-id="/index.xhtml"
login-view-id="/index.xhtml">
<!-- Couple of notes about the attributes in the root element pages:
<conversation name="regmem"
parameter-name="memberID"
parameter-value="#{memberreg.newMember.memberID}"/>
<page view-id="/register.xhtml">
<param name="memberID" value="#{memberreg.newMember.memberID}"/>
<navigation from-action="#{memberreg.start}">
<begin-conversation join="true" conversation="regmem"/>
<rule if="#{memberreg.started}">
<redirect view-id="/register1.xhtml"/>
</rule>
</navigation>
<navigation>
<rule if="#{memberreg.agree}">
<redirect view-id="/register2.xhtml"/>
</rule>
<rule if="#{memberreg.started and not memberreg.agree}">
<redirect view-id="/register1.xhtml"/>
</rule>
<rule if="#{identity.loggedIn}">
<redirect view-id="/memberadmin.xhtml"/>
</rule>
</navigation>
</page>
<page view-id="/register1.xhtml" conversation-required="true"
conversation="regmem">
<restrict>#{memberreg.started}</restrict>
<navigation from-action="#{memberreg.agreeToLicense}">
<rule if="#{memberreg.agree}">
<redirect view-id="/register2.xhtml"/>
</rule>
</navigation>
<navigation from-action="#{memberreg.cancel}">
<rule if="#{not memberreg.agree}">
<redirect view-id="/index.xhtml"/>
<end-conversation/>
</rule>
</navigation>
<navigation>
<rule if="#{identity.loggedIn}">
<redirect view-id="/memberadmin.xhtml"/>
</rule>
</navigation>
</page>
<page view-id="/register2.xhtml" conversation-required="true"
conversation="regmem">
<restrict>#{memberreg.agree}</restrict>
<navigation from-action="#{memberreg.end}">
<rule if="#{memberreg.ended}">
<redirect view-id="/index.xhtml"/>
<end-conversation/>
</rule>
</navigation>
<navigation>
<rule if="#{identity.loggedIn}">
<redirect view-id="/memberadmin.xhtml"/>
</rule>
</navigation>
</page>
<exception class="org.jboss.seam.security.NotLoggedInException">
<end-conversation/>
<redirect view-id="/index.xhtml">
<message severity="warn">You are not logged in.</message>
</redirect>
</exception>
<exception class="org.jboss.seam.security.AuthorizationException">
<end-conversation/>
<redirect view-id="/index.xhtml">
<message severity="warn">You are not authorized.</message>
</redirect>
</exception>
</pages>