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



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

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


satchidanand mohanty
how to display one image on jsp through java
1 Answer(s)      3 years and 6 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
display image on jsp
display image on jsp  how to display image from database which path is coming in string. i want to display image and its discription and price... is downloading on jsp. show i can open it. but i want to display that image on jsp
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 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
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
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
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
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, 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
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
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
 

 

 

DMCA.com