Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet how to display one image on jsp through java

Have Programming Question? Ask it here!
 
 
 


satchidanand mohanty
how to display one image on jsp through java
1 Answer(s)      3 years and 4 months ago
Posted in : JSP-Servlet


Hi,

I wanted to display one image on my jsp file like social networking sites. But the scenario is that the image file is not inside the project folder. That is inside the C://upload/image.jpg . what is the procedure to get that and display on my jsp page.

Thanks in advance.

S N Mohanty


Advertisement
View Answers

April 8, 2011 at 3:21 PM


<%@ page import="java.io.*" %>
<%@page contentType="image/gif" %><%
    OutputStream o = response.getOutputStream();
    InputStream is = new FileInputStream(new File("C:/images/image.gif"));
    byte[] buf = new byte[32 * 1024]; 
    int nRead = 0;
    while( (nRead=is.read(buf)) != -1 ) {
        o.write(buf, 0, nRead);
    }
    o.flush();
    o.close();
    return; 
%>


Related Tutorials/Questions & Answers:
how to display one image on jsp through java
how to display one image on jsp through java  Hi, I wanted to display one image on my jsp file like social networking sites. But the scenario...://upload/image.jpg . what is the procedure to get that and display on my jsp page
image display in jsp - Java Beginners
image display in jsp  i uploaded the image and how can i print that image in next jsp page....  Hi friend, read for more information, http://www.roseindia.net/jsp/file_upload/employee_upload_profile_image.shtml
Advertisements
how to display or retrive an image in jsp whose path is stored in oracle database
how to display or retrive an image in jsp whose path is stored in oracle database  how to display or retrive an image in jsp whose path is stored in oracle database and the image is stored in my pictures folder
image display - JSP-Servlet
image display  how to display image that store in mysql database... column have BLOB datatype....  Hi Friend, Please visit the following link: http://www.roseindia.net/jsp/retrieve-image.shtml Thanks
how to display image and text in single jsp page from the mysql database
how to display image and text in single jsp page from the mysql database  hello please help me to display the image and text in single jsp page from mysql database if have any reference code please send me Thanks in advance
how to display image with listview
how to display image with listview  How can i display the list view with the related images from database
How display a Image on servlet from file upload - JSP-Servlet
How display a Image on servlet from file upload  Dear Sir, I were ask a question that How display the Image on servlet through file upload. Today I get your answer. But Sir, It code not display the image on servlet
display image using jsp
display image using jsp  display image using jsp and phonegap on emulator of eclipse   Here is a simple jsp code that displays an image on browser. <%@ page import="java.io.*" %> <%@page contentType="image/gif
How display a image on servlet from file upload - JSP-Servlet
How display a image on servlet from file upload  Dear Sir, My issue is: How display a image on servlet from file upload I receive your answer today...(); } } } web.xml one javacode.UploadFile one /jsp/UploadFile But that code
Jsp Image Display
Jsp Image Display  Hi,i need to display image in a Box like in profile photo,when i click on the browse button,file gets open and the selected image... to save it in a database....Kindly post JSP codes..Its Urgent, I m very thankful t
How display a image on servlet from file upload - JSP-Servlet
How display a image on servlet from file upload   Dear Sir, My Question is: How display a image on servlet from file upload Your Answer: Hi... reason is inaccessible Thanks Sir, But Servlet page nothing display any type
How display a Image on Servlet from file upload - JSP-Servlet
How display a Image on Servlet from file upload  Dear Sir, My requirement is I want to display a Image on Servlet from File Upload...; filename=\"image.jpg\""); System.out.println("One image writting
how to display the image in center - Ajax
how to display the image in center  i want to dispaly the image as center of the screen using javascript..while i am clicking the button ..any one give me the code for this one
jsp image display
jsp image display  this is my saveImage.jsp file: <...); String updateQuery="update stu_info set image_path=? where... message is"+e.getMessage()); out.print("error"); } %> how can i create
JSP:select image for db and display in image tag
JSP:select image for db and display in image tag  Hi, i am new to this forum. My query is that, i am trying to display image in image tag but i am not getting, how to do this by using this code. plz help me. if(rs1.next
JSP:select image for db and display in image tag
JSP:select image for db and display in image tag  Hi, i am new to this forum. My query is that, i am trying to display image in tag but i am...); response.getOutputStream().flush(); } i think, this code will display image
JSP:select image for db and display in image tag
JSP:select image for db and display in image tag  Hi, i am new to this forum. My query is that, i am trying to display image in tag but i am...); response.getOutputStream().flush(); } i think, this code will display image
how to display image from byte arry - Java Magazine
how to display image from byte arry  Hi.. How to display a image using byte array[] object , which have the image data in binary format. If it can be resolved , itz very helpful for me. Regards Rajesh
How to Display Duplicate elements from more than one List in java?
How to Display Duplicate elements from more than one List in java?  How to Display Duplicate elements from more than one List in java? //I mean... How to Display common elements Display   Hare is an example
How to copy an jpeg image from one folder to other folder using jsp
How to copy an jpeg image from one folder to other folder using jsp  How to copy an image from one folder to another folder using jsp
Retrieve image from mysql database through jsp
Retrieve image from mysql database through jsp... to retrieve image from mysql database through jsp code. First create a database.... mysql> create database mahendra; Note : In the jsp code given below, image
image display - Java Beginners
image display  i need to display all the images from the folder and i dont want give the image path.dynamically it should display. please help  Hi friend, Code to help in solving the problem var
image display - Java Beginners
image display   "" ...*" %><html><head><title>Retrive Image with jsp</title></head><body><img src="/jsp/red_rose2.gif" name="
Display Image in Java
Display Image in Java     ...): Pass the boolean value as true to display the image or Vice-Versa. Here we are passing the boolean value as true to display the image on the frame
How to copy an jpeg image from one folder to other folder using jsp
How to copy an jpeg image from one folder to other folder using jsp  ... be in my image folder...so,How to copy an jpeg image from one folder to other folder using jsp or servlet
java image display - Java Beginners
java image display  How to display images in the folder dynamically with out using database using java and jsp  Hi friend, Code to help in solving the problem var galleryarray=new Array
Insert Image in DB through Servlet - JSP-Servlet
Insert Image in DB through Servlet  Dear Sir, I am not able to solve my problem cocerning Inserting the image in Database through Servlet. I am usng...("***********"); System.out.println("Successfully display image from databse
how display jsp frame - Java Beginners
how display jsp frame  Hi all, I am creating two jsp in frame... 1)In the code, you have provided,we have created another jsp 'new.jsp' in order to open the link on this jsp frame.It is having no code. Jsp Frameset
Insert Image in DB through Servlet - JSP-Servlet
Insert Image in DB through Servlet  Dear Sir, My previous Query that: I want to add the Image In databse using servlet. I have a program Its fine...(); System.out.println("Successfully display image from database ....."); ResultSet rs
J2me image display - Java Beginners
J2me image display  How can i display a jpeg image in j2me  Hi Friend, Please visit the following links: http://www.roseindia.net/j2me/append-image.shtml http://www.roseindia.net/j2me/image-item-example.shtml
Insert Image In DB through Servlet - JSP-Servlet
Insert Image In DB through Servlet  Dear Sir, My previous Query... the image through servlet.But Sir, I am using weblogic so I do not want the reference...()); pstmt.executeUpdate(); System.out.println("Successfully display image from
Upload Image to Database through Servlet - JSP-Servlet
Upload Image to Database through Servlet  Hello, I make a application from where I upload the Image from local disk then store in DB.Before storing the Image in DB I want to check this program. I include the commons
Insert Image in DB through Servlet - JSP-Servlet
Insert Image in DB through Servlet  Dear Sir, You write me: copy this link and paste in your Url http://rs236.rapidshare.com/files/144453519/New... A new Page displayed, check there a Round Shaped Image Called "download" click
Insert Image In DB through Servlet - JSP-Servlet
Insert Image In DB through Servlet  Dear Sir, I want to add the Image In databse using servlet. I have a program Its fine run on command prompt...()); } } } Whether Any entry will be made in web.xml when Insert Image in Databse using servlet
Insert Image In DB through Servlet - JSP-Servlet
Insert Image In DB through Servlet  Dear Sir, My previous Query that: I want to add the Image In databse using servlet. I have a program Its fine...(e.getMessage()); } } } Whether Any entry will be made in web.xml when Insert Image
Retrview image from sqlserver2000 and display in jsp - JSP-Servlet
Retrview image from sqlserver2000 and display in jsp  How to retreview image from sqlserver2000 to jsp? pls give the solution i am using Tomcat 4... for more information, http://www.roseindia.net/jsp/ Thanks
How to display data in jsp from dao using java beans?
How to display data in jsp from dao using java beans?  Hi I need to display data in jsp pulling from dao using java beans, Please can anyone give me the sample application with above topics. Any help would be highly appreciated
Display image on JSP page using XML
Display image on JSP page using XML  ... can display a image on JSP page by using XML.  This example will examine how to parse and expose XML information using the JAXP with a JSP page
image display
for uploading image in ms access database and also seen the result of displaying image from access database but Sir I want that how I display image from database...image display  hello sir this is saurav srivastav, I am developing my
Display Java in JSP
Display Java in JSP  please i need urgent help. How can i display Java Applet created in netbeans in JSP?. the Application involves MYSQL Database connection. Thanks
how to display the email message in jsp
how to display the email message in jsp  hi every one .. i am new from this industry please help me to display the email message in jsp page please send me sample code
Display image
Display image  How to Pass image from html to jsp and display that image using jsp   Here is an example that pass an image path from the html page to jsp page and display it. 1)page.html: <%@ page language="java
How to connect one application to some othe application through Rest json
How to connect one application to some othe application through Rest json  Hi All, Im new to Rest json How to connect one application to some othe application through Rest json? I need only Rest json plz help
how to use image tag in jsp
how to use image tag in jsp  How to use image tag in JSP
Adding image to database through jsp or HTML page ,while adding only image should show.
Adding image to database through jsp or HTML page ,while adding only image should show.   Adding image to database through jsp or HTML page,while adding only image should show. After that i need view that uploaded image from
how to connect the database using hibernet through servlet/jsp through form
how to connect the database using hibernet through servlet/jsp through form  plz give me the reply   Hi Friend, Please visit the following link: http://www.roseindia.net/jsf/myfacesspring/loginRegistration.shtml Hope
image display
to display in image from databse plz help me i will wait for ur reply...image display  sir the answer which you have sent to me is already I have I want to know that the syntax which you have writen for display
image display
image display  Hai Friends..... Actually I uploaded filepath into database and image into a folder. Now i want to show that image as my profile photo. How it is?...Friends Can you help me? Thanks in advance to take time
image display
image display  Hai Friends..... Actually I uploaded filepath into database and image into a folder. Now i want to show that image as my profile photo. How it is?...Friends Can you help me? Thanks in advance to take time
Upload and display image and text records using JSP and Oracle
Upload and display image and text records using JSP and Oracle  Hi all, I'm using JSP and Oracle 10g. I could retrieve and display records from database. But i couldnot retrieve and display image. I want to store
 

 

 

DMCA.com