CAPTCHA Support

CAPTCHA is a technique for preventing forms being filled in automatically by programs. A challenge (usually an image containing distorted characters) is displayed, and the user submitting a form is required to provide a correct response (usually by entering the characters displayed in the image).

Escenic Content Engine comes with built-in feature to add Captcha to different actions. The Forum plug-in action classes use this Captcha support allowing you to easily add CAPTCHA fields to your posting submission forms. Please see the Advanced Developer Guide for instructions on how to setup Captcha.

In order to configure your Forum action classes to verify captcha response, Open WEB-INF/struts-config-forum.xml for editing, and enable the CAPTCHA checks you want by setting the parameter checkCaptcha to true. For example:

<action path="/insert/posting"
type="com.escenic.forum.struts.presentation.InsertCommentAction"
parameter="checkCaptcha=true"
...
/>

The following Struts actions support CAPTCHA checks:

  • com.escenic.forum.struts.presentation.InsertCommentAction

  • com.escenic.forum.struts.presentation.AuthenticatedInsertCommentAction

  • com.escenic.forum.struts.presentation.InsertPostingAction

  • com.escenic.forum.struts.presentation.AuthenticatedInsertPostingAction

You will then need to redeploy the publications. For general information about developing and deploying Escenic publications, see the Escenic Content Engine Template Developer Guide.

In order to show the Captcha image and include captcha field, please see Advanced Developer Guide.

You can include a JSP segment like this in your posting submission HTML form to show the error when the captcha response is invalid:

<p class="fieldError" id="errorfield(CAPTCHA)">
  <html:messages
    bundle="Validation"
    id="error"
    message="true"
    property="CAPTCHA">
    <bean:write name="error"/>
  </html:messages>
</p>