File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JCaptcha and Struts problem

 
Em Aiy
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using JCaptcha for captcha features. It is working fine. I have this code in CaptchaServlet and this code save the captcha in request



Now, i get this captcha in form Action from req and validate it etc.

In that form i set the following header for the JSP page



So that my captcha does not remain in cache. Now there is one issue. If i keep the page open for 10-15 minutes and after that i submit it, the actionform does not find any captcha (ok fine - make sense). The page is re-displayed but it display with the LAST CAPTCHA (it does not generate the new one) or at least generate the new one but does not show it.

So what coould be possible modification should i made so that my PAGE GURANTEE to show the new CAPTCHA IMAGE each time it loads (F5 or CTRL + F5).
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33691
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Muhammad,
Is using POST an option? That would force a trip to the server where you could create a new captcha.
 
Em Aiy
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using this code in CaptchaServlet POST method



Here is the code i have writen in action form, which validate the captcha


Now, when the exception occurs, it sends back to the url with "ERROR" message and it does not update the captcha (most of the time).
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic