Image verification system in JSP.

Hi!
Do anyone tell me the code for the image verification system in JSP.
I have a user registration system.. where i have implement image verification
in user registration system...
Thanking You
Sanjoy ..

Hi,
Are you looking at something like a captcha image authentication or what ??
If that is you requirement there are many 3rd party libraries/APIs for this purpose.
Please find the below
http://jcaptcha.sourceforge.net/
http://simplecaptcha.sourceforge.net/and if you are looking the implementation part here are we.
http://www.javaworld.com/javaworld/jw-03-2005/jw-0307-captcha.html
http://www.andrewtimberlake.com/blog/2006/06/developing-a-captcha-implementation-in-java.htmlHope that might help :)
REGARDS,
RaHuL

Similar Messages

  • BLOB image not shows in JSP page!!

    Hi Dear all,
    I had tried to configure how to show BLOB image to jsp page . The code are works fine and servlet works ok but image can not show only. can you help me that what need to be added. Please help me.
    Can any experts help me? BLOB image not shows in JSP page. I am using ADF11g/DB 10gR2.
    My as Code follows:
    _1. Servlet Config_
        <servlet>
            <servlet-name>images</servlet-name>
            <servlet-class>his.model.ClsImage</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>images</servlet-name>
            <url-pattern>/render_images</url-pattern>
        </servlet-mapping>
      3. class code
    package his.model;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Iterator;
    import java.util.Map;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    import oracle.jbo.client.Configuration;
    import oracle.jbo.domain.BlobDomain;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    public class ClsImage extends HttpServlet
      //private static final Log LOG = LogFactory.getLog(ImageServlet.class);
      private static final Log LOG = LogFactory.getLog(ClsImage.class);
      public void init(ServletConfig config)
        throws ServletException
        super.init(config);
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
        throws ServletException, IOException
        System.out.println("GET---From servlet============= !!!");
        String appModuleName = "his.model.ModuleAssetMgt";//this.getServletConfig().getInitParameter("ApplicationModuleName");
        String appModuleConfig = "TempModuleAssetMgt";//this.getServletConfig().getInitParameter("ApplicationModuleConfig");
        String voQuery ="select ITEM_IMAGE from MM_ITEMIMAGE where IMAGE_NO = 'P1000000000006'" ;// 'P1000000000006' this.getServletConfig().getInitParameter("ImageViewObjectQuery");
        String mimeType = "jpg";//this.getServletConfig().getInitParameter("gif");
        //?IMAGE_NO='P1000000000006'
        //TODO: throw exception if mandatory parameter not set
        ApplicationModule am =
          Configuration.createRootApplicationModule(appModuleName, appModuleConfig);
          ViewObject vo =  am.createViewObjectFromQueryStmt("TempView2", voQuery);
        Map paramMap = request.getParameterMap();
        Iterator paramValues = paramMap.values().iterator();
        int i=0;
        while (paramValues.hasNext())
          // Only one value for a parameter is expected.
          // TODO: If more then 1 parameter is supplied make sure the value is bound to the right bind  
          // variable in the query! Maybe use named variables instead.
          String[] paramValue = (String[])paramValues.next();
          vo.setWhereClauseParam(i, paramValue[0]);
          i++;
       System.out.println("before run============= !!!");
        // Run the query
        vo.executeQuery();
        // Get the result (only the first row is taken into account
        System.out.println("after run============= !!!");
        Row product = vo.first();
        //System.out.println("============"+(BlobDomain)product.getAttribute(0));
        BlobDomain image = null;
        // Check if a row has been found
        if (product != null)
          System.out.println("onside product============= !!!");
           // We assume the Blob to be the first a field
           image = (BlobDomain) product.getAttribute(0);
           //System.out.println("onside  run product============= !!!"+image.toString() +"======="+image );
           // Check if there are more fields returned. If so, the second one
           // is considered to hold the mime type
           if ( product.getAttributeCount()> 1 )
              mimeType = (String)product.getAttribute(1);       
        else
          //LOG.warn("No row found to get image from !!!");
          LOG.warn("No row found to get image from !!!");
          return;
        System.out.println("Set Image============= !!!");
        // Set the content-type. Only images are taken into account
        response.setContentType("image/"+ mimeType+ "; charset=windows-1252");
        OutputStream os = response.getOutputStream();
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[4096];
        int nread;
        while ((nread = is.read(buffer)) != -1)
          os.write(buffer, 0, nread);
          //System.out.println("Set Image============= loop!!!"+(is.read(buffer)));
        os.close();
        // Remove the temporary viewobject
        vo.remove();
        // Release the appModule
        Configuration.releaseRootApplicationModule(am, false);
    } 3 . Jsp Tag
    <af:image source="/render_images" shortDesc="Item"/>  Thanks.
    zakir
    ====
    Edited by: Zakir Hossain on Apr 23, 2009 11:19 AM

    Hi here is solution,
    later I will put a project for this solution, right now I am really busy with ADF implementation.
    core changes is to solve my problem:
        byte[] buffer = new byte[image.getBufferSize()];
        int nread;
        vo.remove();
        while ((nread = is.read(buffer)) != -1) {
          os.write(buffer);
        }All code as below:
    Servlet Code*
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response) throws ServletException,
                                                             IOException {
        String appModuleName =
          "his.model.ModuleAssetMgt";
        String appModuleConfig =
          "TempModuleAssetMgt";
      String imgno = request.getParameter("imgno");
        if (imgno == null || imgno.equals(""))
          return;
        String voQuery =
          "select ITEM_IMAGE from MM_ITEMIMAGE where IMAGE_NO = '" + imgno + "'";
        String mimeType = "gif";
        ApplicationModule am =
          Configuration.createRootApplicationModule(appModuleName,
                                                    appModuleConfig);
        am.clearVOCaches("TempView2", true);
        ViewObject vo = null;
        String s;
          vo = am.createViewObjectFromQueryStmt("TempView2", voQuery);
        // Run the query
        vo.executeQuery();
        // Get the result (only the first row is taken into account
        Row product = vo.first();
        BlobDomain image = null;
        // Check if a row has been found
        if (product != null) {
          // We assume the Blob to be the first a field
          image = (BlobDomain)product.getAttribute(0);
          // Check if there are more fields returned. If so, the second one
          // is considered to hold the mime type
          if (product.getAttributeCount() > 1) {
            mimeType = (String)product.getAttribute(1);
        } else {
          LOG.warn("No row found to get image from !!!");
          return;
        // Set the content-type. Only images are taken into account
        response.setContentType("image/" + mimeType);
        OutputStream os = response.getOutputStream();
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[image.getBufferSize()];
        int nread;
        vo.remove();
        while ((nread = is.read(buffer)) != -1) {
          os.write(buffer);
        is.close();
        os.close();
        // Release the appModule
    Configuration.releaseRootApplicationModule(am, true);
    }Jsp Tag
    <h:graphicImage url="/render_images?imgno=#{bindings.ImageNo.inputValue}"
                                                        height="168" width="224"/>

  • I tried to display gif image from oracle to jsp but nothing appear

    i tried to display image from oracle DB to jsp directly without using file processing , and i used Servlet and jsp , Servlet to get image from DB and jsp to use <img> tag , when i Run Servlet code
    the image appaer on Microsoft Photo Editor , and when i run jsp the image dose not appear on jsp page , so please anyone has an idea about this broblem ,send the soluation or any information to my e-mail [email protected] , and I'll thankful about your help.
    the Servlet and jsp code are below .
    thank for your help
    Servlet:
    import java.io.InputStream;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    public class Servlet extends HttpServlet
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    response.setContentType("image/gif");
    int id = Integer.parseInt(request.getParameter("no"));
    // int id = 2 ; when Run Servlet .
    ResultSet rs = null;
    Connection Lcon = null;
    String stmt = " select Image from ImageTable where lmage_id ="+id;
    Statement sm = null;
    String data1 ="";
    try
    Lcon = getConntcion();
    sm = Lcon.createStatement();
    rs = sm.executeQuery(stmt);
    if(rs.next())
    InputStream in = rs.getBinaryStream(1);
    ServletOutputStream sout = response.getOutputStream();
    int c;
    while((c=in.read())!= -1)
    sout.write(c);
    in.close();
    sout.flush();
    sout.close()
    }catch(Exception e)
    System.out.println("error in selectValue the error is "+e);
    finally
    rs .close( );
    sm .close( );
    Lcon.close( );
    public Connection getConntcion()
    Connection con = null;
    try{
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = DriverManager.getConnection(",,,,,,,, DB Info ,username and password ,,,,,,,,,,,");
    }catch(Exception e)
    System.out.println("error in connection the error is "+e);
    return con;
    Jsp code :
    <%@ page contentType="text/html"%>
    <html>
    <head
    </head>
    <title> testing image </title>
    <body>
    <form>
    <img src="servlet/Servlet?no=2">
    </form>
    </body>
    </html>

    InputStream in = rs.getBinaryStream(1);
    byte[] image= null;
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    byte[] buffer = new byte[8192];
    int bytesRead = 0;
    while ((bytesRead = in.read(buffer, 0, 8192)) != -1)
         baos.write(buffer, 0, bytesRead);
    image= baos.toByteArray();
    in.close();
    ServletOutputStream sout = response.getOutputStream();
    if (image != null)
           sout.write(image);
           sout.flush();
    }

  • HT201250 Hello i am using TimeMachine to back-up entire Mac image (data + system) on an usb-local drive. I would like (on top of it) add a specific plan to back up some files on a remote network drive. Does TimeMachine support multiple back-up plans ? How

    Hello i am using TimeMachine to back-up entire Mac image (data + system) on an usb-local drive. I would like (on top of it) add a specific plan to back up some files on a remote network drive. Does TimeMachine support multiple back-up plans ? How ?

    Time Machine is capable of backing up to multiple locations, and can be used to back up to both a local hard drive and a networked drive (provided that that drive is in or connected to a Time Capsule or another Mac that is sharing it over the network). The catch, though, is that you can't specify different things to back up to different destinations. Whatever you exclude from Time Machine backups is excluded from ALL backups, and whatever is included is included on all.
    So, get a large enough drive that you can back up everything you want in all locations, or use something else for maintaining the network backup.
    More information on these topics can be found here:
    How do I set up Time Machine to a shared drive on another Mac?
    How do I set up Time Machine to a Time Capsule or Airport Extreme?
    "Rotating" Time Machine backup disks

  • Image Management System

    Is it possible to employ photoshop album starter edition as an image management system for our College staff? The system would require to be searchable over out Intranet and contain many images.

    It depends exactly what you want to be able to do. I doubt very much whether you could really get the functionality you'd need, as it's not was PSA SE 3 was designed for.
    The paid-for versions have slightly more flexibility, but they are not designed to be multi-user. There are other products designed for such purposes, but they tend to be a little costly.

  • While invoice verification system calculating tax on delivery costs also

    hi Guru's
       i am facing problem that , wile invoice verification system calculating tax on delivery costs also , and when i am removing tax code in front of dilivery costs , invoice is not posting , i can use zero tax code for delivery costs , but i dont want to use  any tax code for delivery cost , what should i do 
          please help

    HI,
    invoice is not posting , i can use zero tax code for delivery costs , but i don't want to use any tax code for delivery cost , what should i do
    You have to use tax code for that with ZERO tax code,its like import condition where we used zero tax code
    No other option!!!
    Regards
    Kailas Ugale

  • Related to Invoice verification system messages

    Hi Experts,
    This is related to invoice verification system messages.
    Client requirement is to configure each system message which are related to logistics invoice verification for almost 1000 user id's.
    Total number of user id's: more than 10,000 in the client instance.
    Ex: Message id 232
         Need to configure message id 232 1000 times, each entry with one user id in the transaction OMRM.
    Similarly, we need to configure almost 500 system messages for the 1000 user id's.
    So, practically it's very difficult to maintain each system message for these many id's.
    If we are keeping user id filed blank, then these message setting will be applicable for the remaining user id's also, for which these messages are not required to display.
    Kindly please advice how to configure this.
    Is it possible to configure these messages at user group id level or any other option.
    Kindly update ASAP.
    Thanks in advance
    Regards
    KRK

    Hi,
    Ok, I will ask same question in different manner.
    In the OMRM transaction, is it possible to give user group id instead of user id for the respective system message id?
    Ex:
    System message id - User group id instead of user id - Message status
    Could you please confirm, whether it is possible or not
    Thanks in advance
    Regards
    KRK

  • Display the images in excel using jsp

    Hi
    I am unable to display the images in excel using jsp. I can display the data. but cannot display the images. It is simply showing the icon without the image. Is there any way to display the images. Pls give some sample code to display the images in excel.
    Thanks in advance.

    Presumably whoever created the images in that Excel document just put links to somewhere on their hard drive. Those links don't mean anything when you put the document on somebody else's computer, which is what you are doing. At least, that is my guess.
    You could spend some time looking at the Excel file to see how the images were put in there. Or you could ask the person who put the images in there.

  • I have a 13" macbook from 2009 and for some reason can no longer change my desktop image by just clicking on an image in system prererences I-Photo. Does anyone know what the problem could be?

    I have a 13" macbook from 2009 and for some reason can no longer change my desktop image by just clicking on an image in system prererences>I-Photo. Does anyone know what the problem could be?

    Your Desktop Picture settings and Dock items are stored in the files
    /Users/your short user name/Library/Preferences/com.apple.desktop.plist and
    /Users/your short user name/Library/Preferences/com.apple.dock.plist
    in the "Preferences" folder in your user library. This looks like the system has trouble to write to these files. Check the permissions on your user library and remove the above files from your user library, then log off and on again.
    Your user library is hidden in Lion and Mt. Lion. To reveal it, use the Finder's "Go" menu. Select "Go" in the Finder's main menu bar and hold down the alt/option key, until you see the "Library"  in the drop-down menu. Double click it to open a Finder window, so you can browse the files inside.
    Regards
    Léonie

  • Image Verification

    Dear all,
    I have seen in so many registration pages asking to type the images shown in random manner.Is any tool available for doing that or how to do that.Any please suggest any url to get information.
    Thanks in advance,
    Karthik

    Hai,
    Thanks for the post.But iam looking for image
    verification in registration sites.But that
    focussed on image processing.I need a third party
    plugin tool for my web portel or a manual for doing
    it
    egards,
    KarthikAh, I see. Try JCaptcha then:
    http://jcaptcha.sourceforge.net/

  • Is it posssible to lunch one application from the client system using JSP

    Is it possible to Lunch one application from the client system using JSP or Servlet .If it is possible then how can we do that ?
    Thanks in advance
    Sil

    If its a java application - yes. You can use jnlp and web start.
    ram.

  • SOLVED!!!!!!!!!Placing an Image in original login.jsp

    Hi all,
    I solved the problem of placing an image in original login.jsp
    Hope this will be usefull for all who will be trying to edit the original longi.jsp:
    ====>Place your image in the following folder:
    C:\installations\Oracle_Infra(Your oracle_home)\portal\images
    you place your image some-where else it will not be displayed .....
    Hope this will be usefull!!!!
    Thanks & Regards,
    Mallikarjun

    Well, you are quite right to put images in this place.
    However, two points can be noted here:
    1. This works with the assumption that your portal repository is in the infra-database. in cases of customer databases, you may have other folders which would be able to run the images from a similar folder in their respective homes.
    2. Additionally, you can place your images anywhere on your servers and still have them working if you use an alias for the image folder location!
    hope that helps.
    syed

  • Suddenly unable to post comments on iWeb blog - image verification error

    People suddenly can't post comments to my blog page (web.me.com/stannerory). I've tried this myself, and posting continuously fails at the image verification process, one receives an error message that says the letters entered don't match the image, yet they do. Someone suggested that cutting the comment, closing, reopening, and pasting, and doing the process a second time would work, but I haven't found this to be successful either. Is there some kind of a workaround? Anyone else having this issue?

    OT -
    Thanks for your efforts.
    It seems to be intermittent now, which is an improvement. I still can't add or remove a comment without fail. It's some consolation that it might be a server issue, but if it were, wouldn't there be all kinds of unhappy Apple users complaining about the issue, AND wouldn't the mobileMe website have some kind of problem indicator light flashing? Of course it would.

  • Image Verification - PC doesn't display

    Designed my site using iWeb, works great on the G4. The PC is running XP and Internet Explorer 7. When I use the browser to add a comment from the PC laptop, the Image Verification is just a grey box/white background/red x inside. Help.
    G4   Mac OS X (10.4.8)  
    G4   Mac OS X (10.4.8)  

    Tried Firefox and couldn't replicate the error. Today, input a "false" Image Verification code (IE7 SP2), got the message that the code was in error, and I can now see the second random Image Verification Code. At least this allows a way to get a comment posted from this PC. Thanks for your reply.

  • How do I view captcha/image verification images/text boxes, since I can't even though java/javascript is enabled

    I've been using the latest version of FireFox since it was last updated. The captcha/image verification thing that I have been unable to view is one located on FanFiction.Net's login page under the query 'Are you human?'. Its become quite a bother and has been hindering myself from completing my daily routine.
    I have enabled my java/javascript in the tools>options as well as in the add-ons. I also have the latest version java/javascript, yet nothing happened. I have yet to find a solution in the online forums or blogs for my problem.
    I use Windows XP with its latest service pack (3).
    Even the version before the latest one has the same problem for me.

    I just came across a captcha on text.vzw.com that wouldn't work, even after trying all the various suggestions that I've come across.
    What finally worked for me (I'm using FireFox 6.0.2 on top of Windows XP Professional), was allowing popups on that site and allowing session cookies. I think it's the session cookie that finally did it. If you keep your security tight, you can remove the session cookie after you finish what you're doing.
    Barb

Maybe you are looking for