Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Registration page with 'Image Security Code'

 
Gregor Samsa
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone..I need to find a way to build a registration page with 'Image Security Code' with JSP..I will display some random numbers/characters in an Image and the user will have to enter that code in order to register.(like yahoo does) I just wanna prevent automated registrations by doing this..I looked everywhere to find a source/article/code for this in JSP but I couldn't..Does anyone know how to do it ?
Thanks..
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are going to have to display an image either selected from a set of static image files on the server or create one on the fly using the Java graphics capabilities.
If you go dynamic, note that your JSP is just going to write an <img tag which has a src pointing to a servlet that will generate the image. You can use a session variable to contain the code.
I suggest you get the JSP registration page generation working with a static image first.
The topic of serving images has been discussed frequently around here, generally in the context of graphics generated from database results but the principle is the same.
Bill
 
Gregor Samsa
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by William Brogden:
You are going to have to display an image either selected from a set of static image files on the server Bill


I think I'm gonna go with this option thanks Bill..What about the speed ? Does it make any difference from one to another ? (on the fly & static) Which one is faster you think ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64688
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This functionality is known as a "captcha". More info here.

Also google for "java captcha" for lots of links.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about the speed ?

Sigh - another person worrying about speed at the wrong point.
Considering all of the time consuming operations involved in a servlet, the difference between serving a static image file and building one on the fly would be very hard to measure. "Premature optimization is the root of all evil." Get the code correct and clear first.
Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64688
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Premature optimization is the root of all evil." Get the code correct and clear first.


A needle-point sampler saying this should be mandatory on all office/cubicle walls.
 
Gregor Samsa
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks bear && bill 'captcha' was what I was looking for I will try to implement it. If you find any othe tutorials / sources on this please let me know..: )
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64688
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
google
 
kees ... voogd
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can download a simple one here:
http://145.99.209.105/captcha/SimpleCapchaExample.jsp

kj
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64688
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"kees ... voogd",

There aren't may rules that have been put into place here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Gregor Samsa
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by kees ... voogd:
you can download a simple one here:
http://145.99.209.105/captcha/SimpleCapchaExample.jsp

kj


thanks kj : ) bu the link is broken
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic