Hi,
the patch below enables the captch example to create different
captcha-challenges.
I think the two lines should go to the invalidate method. If you agree
I can apply a patch for CaptchaImageResource instead of this one.
Best regards,
Christian
Index: src/main/java/org/apache/wicket/examples/captcha/Captcha.java
===================================================================
--- src/main/java/org/apache/wicket/examples/captcha/Captcha.java
(revision
1063222)
+++ src/main/java/org/apache/wicket/examples/captcha/Captcha.java
(working copy)
@@ -82,6 +82,8 @@
}
// force redrawing
+ imagePass = randomString(6, 8);
+
captchaImageResource.getChallengeIdModel().setObject(imagePass);
captchaImageResource.invalidate();
}
}
@@ -103,7 +105,7 @@
}
/** Random captcha password to match against. */
- private final String imagePass = randomString(6, 8);
+ private String imagePass = randomString(6, 8);
private final ValueMap properties = new ValueMap();