Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 542001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:24:05+00:00 2026-05-13T10:24:05+00:00

I am a newbie at java/java servlet. I need the simpleCaptcha for a form,

  • 0

I am a newbie at java/java servlet. I need the simpleCaptcha for a form, using html and javaservlet for the code. With reference to http://simplecaptcha.sourceforge.net/extending.html.

Captcha captcha = new Captcha.Builder(200, 50)
    .addText()
    .addBackground()
    .addNoise()
    .gimp()
    .addBorder()
    .build(); // Required. 

Where (java servlet) should I put this piece of code in order to create the captcha on html?

Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:24:05+00:00Added an answer on May 13, 2026 at 10:24 am

    To extend SimpleCaptcha and customize your CAPTCHA, my understanding is that you’ll have to create your own HttpServlet (maybe extends SimpleCaptchaServlet). To do so, I suggest to download the source code and to look at SimpleCaptchaServlet or StickyCaptchaServlet. This is what the doGet() method of SimpleCaptchaServlet looks like:

    @Override
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
    
        Captcha captcha = new Captcha.Builder(_width, _height)
            .addText()
            .addBackground(new GradiatedBackgroundProducer())
            .gimp()
            .addNoise()
            .addBorder()
            .build();
    
        CaptchaServletUtil.writeImage(resp, captcha.getImage());
    
        req.getSession().setAttribute(NAME, captcha);
    }
    

    This should be self-explaining: create your own servlet and put your custom Captcha Builder code in the doGet() method. Then, follow the instructions of the Installing section but, instead of using one of their servlet, declare yours in the web.xml. Finally, package/deploy your application. An example is bundled in the source distribution under examples. Check it out if you need more guidance about the structure, the dependencies and the packaging of your web application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a newbie java dev using netbeans IDE 7.1.1 and im watching this
I am quite a newbie in OOP using java and I'm learning as I
Java newbie here, I'm having trouble setting a new line in this code: String
I am a complete newbie with Java. I use notepad++ to write Java code,
I am a java newbie. I have been using Eclipse to test a simple
I'm using Java Logging API in a simple Servlet application that uses Maven and
Java newbie here...caution! I've set this practice app up using this example as a
Java newbie here. I am using a third party library which gives me a
i am a newbie for java server pages and wrote a code for a
I am a java newbie and I am trying to understand the code given

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.