Coach Thrasher

Sunday Mar 25, 2007

Adding CAPTCHA to AppFuse 2 M4

Recently, I've been working on a new project that requires some CAPTCHA support. I've been using AppFuse to jumpstart new projects, and it has just hit AppFuse 2.0-M4, which is quite functional. This post is an update to my JCAPTCHA with AppFuse via Struts guide, which focused on AppFuse v1.9.x using Ant.

The new AppFuse 2 has migrated to Maven, and I've simplified the jCaptcha integration considerably. Maven integration simplifies everything by automating management of third party libraries (like jCaptcha) and standardizing the project lifecycle. I'm totally in love with it at this point.

In a nutshell, CAPTCHA support is provided by jCaptcha, and all you have to do is download the appfuse-captcha-2.0-M4.zip file and unzip it into your AppFuse "myproject/" directory, and edit your pom.xml to include the jCaptcha libraries. There's a README in the zip that has detailed directions for adding CAPTCHA functionality.

Any page in your AppFuse web application can be protected with a CAPTCHA by editing the security.xml file, but by default the new user "Signup" page is protected. This will make the most sense for any Web 2.0 type projects that require new user registration.

Here's the end result:
AppFuse CAPTCHA Screenshot

If you're developing on a headless Linux system, you'll need to pass the JVM the parameter "-Djava.awt.headless=true" to enable headless support. See my previous post about that.

Comments:

Post a Comment:
Comments are closed for this entry.

Calendar

Feeds

Search

Links

Navigation

Referrers