Results 1 to 5 of 5

Thread: Refresh after upload an image in jsp

  1. #1
    Join Date
    Nov 2009

    Refresh after upload an image in jsp

    Hello, I am creating one of the project in java with the help of JSP. And now I want to Refresh the page when upload of an image in jsp page gets completed. If anyone of you know how to achieve it, then please provide me help regarding it. I am not able to get solution for it. So, if you are having solution for it, then please provide help to me.

  2. #2
    Join Date
    May 2008

    Re: Refresh after upload an image in jsp

    Hello, if you make use of the servlet then you can solve your problem by simply making use of the code below:
    DataOutput Out = new DataOutputStream (res.getOutputStream ());
    res.setContentType ( "image / jpeg");
    String img = request.getParameter ( "imageName");
    File filename = null;
    FileInputStream in = null;
    String filenamePath = img.replace ("/", "\ \");
    filename = new File (filenamePath);
    if (File.Exists ())
    in = new FileInputStream (filename);
    res.setContentLength ((int) filename.length ());
    byte value [] = new byte [4096];
    int number;
    while ((number = (value))! = -1)
    Out.Write (value, 0, number);
    in.close ();

  3. #3
    Join Date
    Feb 2008

    Re: Refresh after upload an image in jsp

    Hello, when I was creating program for refreshing the code I have make use of the code below:
    while (
    InputStream IStr =resultSet.getBinaryStream(2);
    int c=0;
    byte[] arr = new byte[4096];
    int size=0;
    while ((c = != -1)
    System.out.println("Blob retrieved");

  4. #4
    Join Date
    Oct 2005

    Re: Refresh after upload an image in jsp

    Hello, I am not able to get your problem properly. If you provide me in details about your problem then I can able to solve it. I want the details below:
    • Is it as home page of your application.
    • To customize the logo there are you using the link of the any other page or you are making use of the hidden form which will appear in your home page.
    • Are you passing any new window for the popup.

  5. #5
    Join Date
    Jan 2008

    Re: Refresh after upload an image in jsp

    Hello, I think you must need to make use of the code below for getting your refresh of page after uploading an image in jsp:

    <% @ Page import = "java.sql .*;"%>
    Connection con = null;
    RequestDispatcher requestD;
    pass String = (String) session.getAttribute ( "pass");
    String lgin = "*****";
    String reqpass = "******";
    String url = "jdbc: mysql ://*******/ schneider_final";
    Class.forName ( "com.mysql.jdbc.Driver"). NewInstance ();
    con = DriverManager.getConnection (url, lgin, reqpass);
    java.sql.Statement statement = con.createStatement ();
    java.sql.ResultSet rs = statement.executeQuery ( "select * from users where pass =" + pass);
    if (rs.first ())
    String logo = rs.getString ( "logo");
    if (logo! = null)
    out.println ( "<img src=\""+request.getContextPath()+"/SrvShowLogo?imageName="+logo+"\">");
    out.println ( "</ div>");
    rs.close ();
    statement.close ();
    catch (Exception e)
    { }

Similar Threads

  1. Using a Custom System Image, Refresh Windows 8
    By Faraji in forum Tips & Tweaks
    Replies: 1
    Last Post: 24-08-2012, 06:10 PM
  2. How to refresh an image control in Silverlight
    By NAKKIRAN in forum Windows Software
    Replies: 4
    Last Post: 13-12-2010, 06:11 PM
  3. How to upload my profile image on Facebook
    By Daniel23 in forum Technology & Internet
    Replies: 3
    Last Post: 19-11-2009, 11:24 PM
  4. Html replace browse image upload
    By Brunoz in forum Software Development
    Replies: 3
    Last Post: 04-08-2009, 03:24 PM
  5. Upload image randomly with JavaScript Page
    By Zubeen in forum Software Development
    Replies: 3
    Last Post: 25-02-2009, 01:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts