[jala] captcha broken?
Anton Pirker <[email protected]> Mon, 04 Aug 2008 10:25:23 +0200
| Newsgroups | gmane.comp.java.helma.general |
|---|---|
| Message-ID | <[email protected]> |
Hi!
I hope i also can ask jala questions in here.
I just wanted to add a jala.Captcha() to my app and it did not work.
First thing was, that the jcaptcha jar file was missing.
I downloaded the latest version, changed the filename in Captcha.js and
tried again. Again no luck.
Captcha.js uses Packages.com.sun.image.codec.jpeg.JPEGCodec which seems
not to be available in OpenJdk Java 1.6.0-b09.
So i changed the code to use javax.imagei like this:
/**
* Render a new captcha image.
*/
this.renderImage = function renderImage() {
var image = captcha.getImageChallenge();
var stream = new java.io.ByteArrayOutputStream();
javax.imageio.ImageIO.write(image, "jpg", stream);
res.contentType = "image/jpeg";
res.writeBinary(stream.toByteArray());
return;
};
Now it works!
Maybe some of the jala folks can add this changes to the repository?
thanks,
Anton
--
DI(FH) Anton Pirker
Helma Freelancer
http://www.ignaz.at
http://shnitzl.org