This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with Simple captcha implementation for sub folders directory

sreenivas jeenor
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I Have to Implement Captcha in my project.

For this I have downloaded source from, which is a Captcha code generator and validator.

When I Place SimpleCapchaExample.jsp in directly into my application folder it works fine.
The Problem lies when I want to Place SimpleCapchaExample.jsp in /jsp/Login/ folder of my Application.
The Page Doesnot show any captcha image or i get a session variable
How should i ssolve this problem


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page
contentType="text/html; charset=ISO-8859-1"
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">



String c= (String)session.getAttribute(nl.captcha.servlet.Constants.SIMPLE_CAPCHA_SESSION_KEY) ;
String parm = (String) request.getParameter("captchafield");

out.println(parm + " ? " + c + ":");

if (c != null && parm != null) {
if (c.equals(parm)) {
}else {


<td><img src="Captcha.jpg"></td>
<td valign="top">
<br>sec code:<input type="text" name="captchafield"><br>
<INPUT type="submit" name="submit">


Please solve my problem

Andrej Szolgay
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Maybe there is a problem in web.xml - try define captcha servlet's url-pattern like following /jsp/Login/Captcha.jpg

or try set url-pattern to /Captcha.jpg and use image definition

Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic