• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JCaptcha and Struts problem

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
author & internet detective
Posts: 41998
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic