[jboss-cvs] jboss-seam/doc/reference/en/modules ...
Gavin King
gavin.king at jboss.com
Wed Nov 7 22:27:10 EST 2007
User: gavin
Date: 07/11/07 22:27:09
Modified: doc/reference/en/modules security.xml
Log:
doc the new way to customize captcha
Revision Changes Path
1.81 +9 -12 jboss-seam/doc/reference/en/modules/security.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: security.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/doc/reference/en/modules/security.xml,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- security.xml 7 Nov 2007 08:56:24 -0000 1.80
+++ security.xml 8 Nov 2007 03:27:09 -0000 1.81
@@ -1284,24 +1284,21 @@
<title>Customising the Captcha image</title>
<para>
- The captcha image itself may be customised by providing an alternative <literal>ImageCaptchaService</literal>
- to the default (<literal>DefaultManageableImageCaptchaService</literal>). To configure a different
- <literal>ImageCaptchaService</literal>, add the following entry to <literal>components.xml</literal>:
+ The engine used to generate the captcha image may be customized in <literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[ <component name="org.jboss.seam.captcha.captchaImage" service="#{customCaptcha.service}"/>]]></programlisting>
+ <programlisting><![CDATA[<captcha:captcha-image" engine-name="com.octo.captcha.engine.image.gimpy.BasicListGimpyEngine"/>]]></programlisting>
<para>
- The <literal>service</literal> attribute specifies the <literal>ImageCaptchaService</literal> instance to
- use to generate captcha images. For more information on configuring an <literal>ImageCaptchaService</literal> please
- refer to the JCaptcha documentation. Here is an example of a custom image generator (which can be found in the
- seamspace example):
+ Alternatively, a customized <literal>ImageCaptchaService</literal> instance may be created programmatically:
</para>
- <programlisting><![CDATA[@Name("customCaptcha")
-public class CustomCaptcha
+ <programlisting><![CDATA[@Name("org.jboss.seam.captcha.captchaImage")
+ at Scope(APPLICATION)
+public class CustomCaptcha extends CaptchaImage
{
- public ImageCaptchaService getService()
+ @Override
+ protected ImageCaptchaService createService()
{
BasicGimpyEngine customCaptcha = new BasicGimpyEngine();
GimpyFactory factory = new GimpyFactory(
More information about the jboss-cvs-commits
mailing list