com.octo.captcha.module.web.image
Class ImageToJpegHelper

java.lang.Object
  extended by com.octo.captcha.module.web.image.ImageToJpegHelper

public class ImageToJpegHelper
extends java.lang.Object

Helper class


Constructor Summary
ImageToJpegHelper()
           
 
Method Summary
static void flushNewCaptchaToResponse(HttpServletRequest theRequest, HttpServletResponse theResponse, Log log, ImageCaptchaService service, java.lang.String id, java.util.Locale locale)
          retrieve a new ImageCaptcha using ImageCaptchaService and flush it to the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageToJpegHelper

public ImageToJpegHelper()
Method Detail

flushNewCaptchaToResponse

public static void flushNewCaptchaToResponse(HttpServletRequest theRequest,
                                             HttpServletResponse theResponse,
                                             Log log,
                                             ImageCaptchaService service,
                                             java.lang.String id,
                                             java.util.Locale locale)
                                      throws java.io.IOException
retrieve a new ImageCaptcha using ImageCaptchaService and flush it to the response.
Captcha are localized using request locale.

This method returns a 404 to the client instead of the image if the request isn't correct (missing parameters, etc...)..
The log may be null.

Parameters:
theRequest - the request
theResponse - the response
log - a commons logger
service - an ImageCaptchaService instance
Throws:
java.io.IOException - if a problem occurs during the jpeg generation process


Copyright 2003-2009 JCaptcha. All Rights Reserved.