-
1. Re: Captcha - custom message
michael.c.small May 18, 2007 10:31 AM (in response to pmilner)I was looking to do the same thing but didn't even realize that the CaptchaResponse annotation existed. My guess is that you need to create a getter method (with above annotation) on the Seam Component that handles the form you are associating the captcha input with.
Because I was unaware of the annotation, I found another solution. If you are using the <s:validate/>/<s:decorate> in combination with the <h:inputText/> for the captcha input, you can use a custom message from your own message bundle:<s:decorate id="captchaDecor"> <h:inputText value="#{captcah.response}" required="true"> <s:validate/> </h:inputText> <s:span rendered="#{invalid}"> <h:outputText value="#{messages.invalidCaptcha}"/> </s:span> </s:decorate>
Note that "invalidCaptcha" should be whatever you named your property in your message bundle. -
2. Re: Captcha - custom message
pmilner May 22, 2007 5:08 AM (in response to pmilner)Thanks Michael -
I'd already tried to add a getter method to the bean and couldn't get it work, but your second suggestion of using the customised s:validate message works really well.
Cheers
Paul -
3. Re: Captcha - custom message
gavin.king May 24, 2007 1:33 AM (in response to pmilner)Please add a feature request to JIRA, this should be more easy to override.
-