I have a very strange issue with one of my forms.
I have a form that registers a user and sends him/her an email. Wanted to replace my old captcha with the new primefaces one. Everything was going fine, but when i click on the submit button(and the captcha is correctly entered), the data is saved in the database, the email is sent, but i dont get redirected to the destination page. Ill show you just a bit of code so you know what i am talking about:
This is the component i just added inside my form
<p:captcha label="Captcha" language="en" theme="white" publicKey="6Ld7pMESAAAAAHd1VihJkqPUXAJVwU3Cghc8fzrq"/>
<h:commandButton value="Registruj"
actionListener="#{registrationControllerBuyer.doRegisterBuyer}"/>
also i added a couple of configurations at the web.xml:
<!-- keys gotten from recaptcha -->
<context-param>
<param-name>primefaces.PUBLIC_CAPTCHA_KEY</param-name>
<param-value>6Ld7pMESAAAAAHd1VihJkqPUXAJVwU3Cghc8fzrq</param-value>
</context-param>
<context-param>
<param-name>primefaces.PRIVATE_CAPTCHA_KEY</param-name>
<param-value>6Ld7pMESAAAAAMhr5WSk5bcRrff8Y08NtDi8Buoq</param-value>
</context-param>
And this is the bit of java for the button handler:
public String doRegisterBuyer() throws Exception {
Buyer buyer = new Buyer();
buyer.setName(getName());
buyer.setSecondName(getSecondName());
buyer.setNickName("not specified");
buyer.setEmail(getEmail());
buyer.setPassword(getPassword());
buyer.setAcceptedTermsAndConditions(isAcceptedTermsAndConditions());
buyer.setNewsletterSubscription(isNewsletterSubscription());
buyer.setAccountStatus(AccountStattus.CREATED.toString());
Buyer tmpBuyer = tmpBuyer = buyersRegistratorEJB.createBuyer(buyer);
// Send activation link to user
emailServiceEJB.sendAccountActivationLinkToBuyer(tmpBuyer.getEmail()
.trim(), tmpBuyer.getName());
return "registrationSucceded.xhtml";
}
The captcha seems to work perfectly: -If i give wrong input to the captcha the method doRegisteredBuyer() don't gets executed -If i get right input to the captcha the method doRegisteredBuyer() does get executed BUT i dont get redirected to registrationSucceded.xhtml
Why is that(the name of the page is correct, already checked that a few times :) )?