You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by C Jennings <co...@yahoo.com> on 2010/04/03 00:08:59 UTC
Does Apache Click support Captchas?
Hi -
Just curious if Apache Click was be integrated with a Captcha Generation Service? I've done this recently using a Spring Framework with JCaptcha. However, that approach required the use of a Spring MVC Controller which is not supported with the Click framework.
If anyone has had an success with implementing a Captcha service with a Click framework, I'd appeciate it if you could share some pointers.
Many thanks
Conor
Re: Does Apache Click support Captchas?
Posted by C Jennings <co...@yahoo.com>.
Bob -
Thank you for pointing me in the right direction. I wasn't aware of creating a Custom Field by extending Field.For anyone else's benefit, starting with Bob's suggestion, I searched the 'Click Examples' Website and found ControlHeadDemo.java that had an inner class, StarRating that extended Field
Conor
----- Original Message ----
From: Bob Schellink <sa...@gmail.com>
To: user@click.apache.org
Sent: Sat, April 3, 2010 9:00:59 AM
Subject: Re: Does Apache Click support Captchas?
On 3/04/2010 11:50 PM, C Jennings wrote:
>
> I wonder, then if it is even possible to embed a Javascript element inside a form using Click? Otherwise, how else could you pass back any arguments to the Page class?
Something like this should work:
public class CaptchaField extends Field {
public String render(HtmlStringBuffer buffer) {
buffer.render("add captcha script output here");
}
}
kind regards
bob
Re: Does Apache Click support Captchas?
Posted by Bob Schellink <sa...@gmail.com>.
On 3/04/2010 11:50 PM, C Jennings wrote:
>
> I wonder, then if it is even possible to embed a Javascript element inside a form using Click? Otherwise, how else could you pass back any arguments to the Page class?
Something like this should work:
public class CaptchaField extends Field {
public String render(HtmlStringBuffer buffer) {
buffer.render("add captcha script output here");
}
}
kind regards
bob
Re: Does Apache Click support Captchas?
Posted by C Jennings <co...@yahoo.com>.
Well I tried a slightly different approach and attempted to implement the reCaptcha web service. This worked fine in my Spring prototype whereby I merely added the sample Javascript below to my form and then read it's request/response parameters in my Spring MVC Controller.
However, when I tried to implement reCapthca using Click, I am unable to pass any values back to my Page class. Both of these parameters return null:
String challenge = getContext().getRequest().getParameter("recaptcha_challenge_field");
String response = getContext().getRequest().getParameter("recaptcha_response_field");
I guess it makes sense as I only have one parameter on my HTM page, namely $form. Since the WebService reCaptcha sript lies"outside" or below the $form on my page, I wonder, then if it is even possible to embed a Javascript element inside a form using Click? Otherwise, how else could you pass back any arguments to the Page class?
Source: http://wheelersoftware.com/articles/recaptcha-java.html
<script type="text/javascript"
src="http://api.recaptcha.net/challenge?k=<your_public_key>">
</script>
<noscript>
<iframe src="http://api.recaptcha.net/noscript?k=<your_public_key>"
height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field"
value="manual_challenge">
</noscript>
Thanks again,
Conor
----- Original Message ----
From: Bob Schellink <sa...@gmail.com>
To: user@click.apache.org
Sent: Sat, April 3, 2010 2:24:04 AM
Subject: Re: Does Apache Click support Captchas?
Hi Conor,
Depends on the markup you need to render for the Captcha service to work. Although I haven't
incorporated a Captcha myself I'd imagine you'll need to create a custom Field that renders the
HTML/JavaScript expected by the captcha service.
kind regards
bob
On 3/04/2010 9:08 AM, C Jennings wrote:
> Hi -
> Just curious if Apache Click was be integrated with a Captcha Generation Service? I've done this recently using a Spring Framework with JCaptcha. However, that approach required the use of a Spring MVC Controller which is not supported with the Click framework.
>
> If anyone has had an success with implementing a Captcha service with a Click framework, I'd appeciate it if you could share some pointers.
>
> Many thanks
>
> Conor
>
>
>
>
Re: Does Apache Click support Captchas?
Posted by Bob Schellink <sa...@gmail.com>.
Hi Conor,
Depends on the markup you need to render for the Captcha service to work. Although I haven't
incorporated a Captcha myself I'd imagine you'll need to create a custom Field that renders the
HTML/JavaScript expected by the captcha service.
kind regards
bob
On 3/04/2010 9:08 AM, C Jennings wrote:
> Hi -
> Just curious if Apache Click was be integrated with a Captcha Generation Service? I've done this recently using a Spring Framework with JCaptcha. However, that approach required the use of a Spring MVC Controller which is not supported with the Click framework.
>
> If anyone has had an success with implementing a Captcha service with a Click framework, I'd appeciate it if you could share some pointers.
>
> Many thanks
>
> Conor
>
>
>
>
Re: Does Apache Click support Captchas?
Posted by C Jennings <co...@yahoo.com>.
Thank You Malcolm..
----- Original Message ----
From: Malcolm Edgar <ma...@gmail.com>
To: user <us...@click.apache.org>
Sent: Fri, April 2, 2010 11:06:27 PM
Subject: Re: Does Apache Click support Captchas?
I know someone at work who as made a Captcha control, he said it was
pretty straight forward. I can see if he want to share it.
regards Malcolm Edgar
On Sat, Apr 3, 2010 at 9:08 AM, C Jennings <co...@yahoo.com> wrote:
> Hi -
> Just curious if Apache Click was be integrated with a Captcha Generation Service? I've done this recently using a Spring Framework with JCaptcha. However, that approach required the use of a Spring MVC Controller which is not supported with the Click framework.
>
> If anyone has had an success with implementing a Captcha service with a Click framework, I'd appeciate it if you could share some pointers.
>
> Many thanks
>
> Conor
>
>
>
>
Re: Does Apache Click support Captchas?
Posted by Malcolm Edgar <ma...@gmail.com>.
I know someone at work who as made a Captcha control, he said it was
pretty straight forward. I can see if he want to share it.
regards Malcolm Edgar
On Sat, Apr 3, 2010 at 9:08 AM, C Jennings <co...@yahoo.com> wrote:
> Hi -
> Just curious if Apache Click was be integrated with a Captcha Generation Service? I've done this recently using a Spring Framework with JCaptcha. However, that approach required the use of a Spring MVC Controller which is not supported with the Click framework.
>
> If anyone has had an success with implementing a Captcha service with a Click framework, I'd appeciate it if you could share some pointers.
>
> Many thanks
>
> Conor
>
>
>
>