[jboss-cvs] jboss-seam/src/main/org/jboss/seam/captcha ...
Gavin King
gavin.king at jboss.com
Wed Jun 20 04:23:17 EDT 2007
User: gavin
Date: 07/06/20 04:23:17
Modified: src/main/org/jboss/seam/captcha CaptchaImage.java
Log:
split up Lifecycle, much better
Revision Changes Path
1.9 +3 -6 jboss-seam/src/main/org/jboss/seam/captcha/CaptchaImage.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CaptchaImage.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/captcha/CaptchaImage.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- CaptchaImage.java 10 Jun 2007 19:25:58 -0000 1.8
+++ CaptchaImage.java 20 Jun 2007 08:23:17 -0000 1.9
@@ -19,7 +19,7 @@
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Startup;
import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.contexts.Lifecycle;
+import org.jboss.seam.contexts.ServletLifecycle;
import org.jboss.seam.servlet.AbstractResource;
import com.octo.captcha.service.CaptchaServiceException;
@@ -80,14 +80,11 @@
{
ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ServletLifecycle.beginRequest(request);
try
{
- Lifecycle.beginRequest( getServletContext(), request );
-
String captchaId = request.getQueryString();
-
BufferedImage challenge = service.getImageChallengeForID( captchaId, request.getLocale() );
-
ImageIO.write(challenge, "jpeg", out);
}
catch (IllegalArgumentException e)
@@ -102,7 +99,7 @@
}
finally
{
- Lifecycle.endRequest();
+ ServletLifecycle.endRequest(request);
}
response.setHeader("Cache-Control", "no-store");
More information about the jboss-cvs-commits
mailing list