Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Implementing a Captcha Test

Though strictly not part of the security API, it might be useful in certain circumstances (such as new user registrations, posting to a public blog or forum) to implement a Captcha ( C ompletely A utomated P ublic T uring test to tell C omputers and H umans A part) to prevent automated bots from interacting with your application. Seam provides seamless integration with JCaptcha, an excellent library for generating Captcha challenges. If you wish to use the captcha feature in your application you need to include the jcaptcha-* jar file from the Seam lib directory in your project, and register it in application.xml as a java module.

Configuring the Captcha Servlet

To get up and running, it is necessary to configure the Seam Resource Servlet, which will provide the Captcha challenge images to your pages. This requires the following entry in web.xml:
<servlet>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
</servlet>
    
<servlet-mapping>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>

 
 
  Published under the terms of the Open Publication License Design by Interspire