Module org.apache.wicket.extensions
Class CaptchaImageResource
java.lang.Object
org.apache.wicket.request.resource.AbstractResource
org.apache.wicket.request.resource.DynamicImageResource
org.apache.wicket.extensions.markup.html.captcha.CaptchaImageResource
- All Implemented Interfaces:
Serializable,IResource,org.apache.wicket.util.io.IClusterable
Generates a captcha image.
- Author:
- Joshua Perlow
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.AbstractResource
AbstractResource.ContentRangeType, AbstractResource.ResourceResponse, AbstractResource.WriteCallbackNested classes/interfaces inherited from interface org.apache.wicket.request.resource.IResource
IResource.Attributes -
Field Summary
Fields inherited from class org.apache.wicket.request.resource.AbstractResource
CONTENT_DISPOSITION_HEADER_NAME, CONTENT_RANGE_ENDBYTE, CONTENT_RANGE_STARTBYTE, INTERNAL_HEADERS -
Constructor Summary
ConstructorsConstructorDescriptionConstruct.CaptchaImageResource(String challengeId) Construct.CaptchaImageResource(String challengeId, int fontSize, int margin) Construct.CaptchaImageResource(IModel<String> challengeId) Construct.CaptchaImageResource(IModel<String> challengeId, int fontSize, int margin) Construct. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringGets the id for the challenge.Gets the id for the challengeprotected final byte[]getImageData(IResource.Attributes attributes) final voidCauses the image to be redrawn the next time its requested.protected Randomprotected byte[]render()Renders this imageMethods inherited from class org.apache.wicket.request.resource.DynamicImageResource
configureResponse, getFormat, newResourceResponse, setFormat, setLastModifiedTime, toImageDataMethods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaders
-
Constructor Details
-
CaptchaImageResource
public CaptchaImageResource()Construct. -
CaptchaImageResource
Construct.- Parameters:
challengeId- The id of the challenge
-
CaptchaImageResource
Construct.- Parameters:
challengeId- The id of the challenge
-
CaptchaImageResource
Construct.- Parameters:
challengeId- The id of the challengefontSize- The font sizemargin- The image's margin
-
CaptchaImageResource
Construct.- Parameters:
challengeId- The id of the challengefontSize- The font sizemargin- The image's margin
-
-
Method Details
-
newRandomNumberGenerator
-
getChallengeId
Gets the id for the challenge.- Returns:
- The id for the challenge
-
getChallengeIdModel
Gets the id for the challenge- Returns:
- The id for the challenge
-
invalidate
Causes the image to be redrawn the next time its requested. -
getImageData
- Specified by:
getImageDatain classDynamicImageResource
-
render
Renders this image- Returns:
- The image data
-