How to display multiple images in jsp

How to display multiple images in jsp

<%@ page import="java.io.*"%>
<%@page import="book.Databasecon"%>
<%@ page import="java.sql.*,java.util.*"%>
<%!OutputStream o; %>
<%!ArrayList<Blob> bl; %>
<html><body>
<%
try {
Connection con =Databasecon.getInstance();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select IMAGE from student_profile ");
//ResultSet rs1=stmt.executeQuery("select count(id) from student_profile");
 bl=new ArrayList<Blob>();
while(rs.next()) {
System.out.println("st-1");
bl.add(rs.getBlob(1));
System.out.println("st-2");
}
//if(rs1.next())
//System.out.println(bl.size()+"size="+rs1.getInt(1));
for(int i=0;i<bl.size();i++){
System.out.println("st-3");
Blob b=bl.get(i);
System.out.println("st-4 "+b);
byte brr[]=new byte[(int)b.length()];
System.out.println("st-6");
brr=b.getBytes(1,(int)b.length());
System.out.println("st-7 "+brr);
// display the image
response.setContentType("image/png");
 o = response.getOutputStream();
 System.out.println("st-8 "+o);
 %>
 <table><tr><td align='left'>
 <img src=<%o.write(brr); %> width="117" height="160"
 >
  </td></tr></table>
  <%
 out.println("<br>");
 System.out.println("st-9 ");
 }
} catch (Exception e) {
out.println("Unable To Display image");
out.println("Image Display Error=" + e.getMessage());
return;
} 
%>
</div></td></tr></table></td></tr>
</table>
</body>
</html>
View Answers









Related Tutorials/Questions & Answers:
How to display multiple images in jsp
How to display multiple images in jsp  <%@ page import="java.io....()); System.out.println("st-7 "+brr); // display the image response.setContentType("image... "); } } catch (Exception e) { out.println("Unable To Display image"); out.println
how to display multiple images on browser
how to display multiple images on browser  i want to display multiple images on brower including string values from sql database using jsp
Advertisements
how to display multiple images on browser
how to display multiple images on browser  i want to display multiple images on brower including string values from sql database using jsp
How to store multiple images in folder and images path in database at a time using jsp?
How to store multiple images in folder and images path in database at a time using jsp?  I wanna browse multiple images in one form and store them in one folder and their path into datrabase
Display Multiple Images in jscrollpane using Java Jpanel
Display Multiple Images in jscrollpane using Java Jpanel  Browse and Display multiple images in vertical view of java jscrollpane using jpanel
display multiple images from postgres database in jframe
display multiple images from postgres database in jframe  i just want to display multiple images on jframe by firing a query on postgres database
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project using this jsp,but i want to CollegeAction class and CollegeForm class how to do
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project using this jsp,but i want to CollegeAction class and CollegeForm class how to do
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project using this jsp,but i want to CollegeAction class and CollegeForm class how to do
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project using this jsp,but i want to CollegeAction class and CollegeForm class how to do
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project using this jsp,but i want to CollegeAction class and CollegeForm class how to do
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project using this jsp,but i want to CollegeAction class and CollegeForm class how to do
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project using this jsp,but i want to CollegeAction class and CollegeForm class how to do
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project using this jsp,but i want to CollegeAction class and CollegeForm class how to do
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project using this jsp,but i want to CollegeAction class and CollegeForm class how to do
How to display images in jsp ffrom sqlserver2000 - JSP-Servlet
How to display images in jsp ffrom sqlserver2000   These code u sent is till not displaying the image in jsp from sqlserver2000. what table... for more information. http://www.roseindia.net/jsp/ Thanks
display records with images problem - JSP-Servlet
, Display images from database to visit ... http://www.roseindia.net/jsp...display records with images problem  hello, i am developing HR... with a unique id. Also i wrote i jsp that link to servlet in order to display
how to scroll multiple images using on Click in Android
how to scroll multiple images using on Click in Android  I am new... there is requirement like multiple image scrolling dynamically. But unfortunately i am unable to scroll multiple images. But i am able to scroll single image. plz let me know
How to display date in JSP?
How to display date in JSP?  How to create a simple JSP program which displays date on the page? Thanks
how to upload and download images using buttons in jsp?
how to upload and download images using buttons in jsp?  how to upload and download images using buttons in jsp
how to save images in oracle using JSP
how to save images in oracle using JSP  how to insert images in oracle using jsp
how to save images in oracle using JSP
how to save images in oracle using JSP  how to insert images in oracle using jsp
How to display date in JSP?
How to display date in JSP?  How to create a simple JSP program which displays date on the page? Thanks   Hi, You should import...() %> Check complete tutorial at How to Create JSP Page? Thanks
jsp images
jsp images  hi I had done a demo application using jsp. And i tried to display some images which is located in the server folder. It has done by using the IP address path of that image folder.. It has been success full in IE
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
how to retrieve images from database to jsp?
how to retrieve images from database to jsp?  Hi sir,i want to stores images along with the name and price with database and retrieve it on jsp.and... display the elaborated image in th next page.plz help me in coding.its vey
How to pass multiple values from a servlet to JSP?
How to pass multiple values from a servlet to JSP?  hi, I want to pass multiple values form a servlet to JSP. Hw do i do that? I am able to send one value at a time without any prb, but I am unable to carry multiple (from two
How to carry multiple values from a Servlet to a JSP?
How to carry multiple values from a Servlet to a JSP?  By using the below code I am able to carry the username to a JSP (single value... needs to be carried from my servlet to a JSP. How do I do
how to display data from database in jsp
how to display data from database in jsp  how to display data from database in jsp
How to display the data column on jsp
How to display the data column on jsp  My requirements: Display total..."; } jsp code: <form id...; </form> It display the data of last database server
how to send mail with multiple attachments in jsp
how to send mail with multiple attachments in jsp  how to send mail with multiple attachments in java script
how insert multiple images in mysql database with use of struts 1.3.8 or java method, with single bean,or using array
how insert multiple images in mysql database with use of struts 1.3.8 or java... ,with struts 1.3.8 and i want to insert multiple images in mysql database ,with use of struts 1.3.8 ,or with the help of Array methods ,like google multiple
pint multiple images from blob database
pint multiple images from blob database  How to display multiple images using blob from mysql database. The program code is as below: <TABLE cellpadding="15" border="1" style="background-color: #ffffcc;"> <
How to Display jrxml file on JSP page???
How to Display jrxml file on JSP page???  I made jrxml file using jasper report but how to display on jsp page?? i tried lot but still i didnt find out solution.so pls help me as soon as possible
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
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
How to display jfreechart at specified place in jsp
How to display jfreechart at specified place in jsp  I have a jsp page where i need to display the chart at specified position... of the jsp page is not displaying.... Below is my code. DefaultPieDataset
how to display selected checkboxes dynamically using jsp
how to display selected checkboxes dynamically using jsp  Hi friends i have a requirement that : in my JSP page i have radio buttons followed by the DB fields..when i click SUBMIT button,if the field(or record
Blob images - JSP-Servlet
Blob images  Hi sir how can i retrieve blob images from database using jsp from mysql  Hi Friend, Please visit the following link: http://www.roseindia.net/jsp/retrieve-image.shtml Hope that it will be helpful
regarding images in jsp
regarding images in jsp  Hi, When I am trying to display an image in jsp, i am getting the image of bar charts in webroots/jspchart/web/jspbarchart.jsp.. But actually I am not getting any image in the browser.. Can any one help
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
upload images - JSP-Servlet
upload images  How to write the jsp code to upload images into database.   Hi Friend, The link we have provided you will allow you...://www.roseindia.net/jsp/upload-insert-csv.shtml Thanks
how to display data in List Or grid or in table in Jsp
how to display data in List Or grid or in table in Jsp   <%@page...(); } %> </body> </html> this is my jsp code i want to display...;JSP Reading Text File</title> </head> <body> <
how to display the excel file content in the jsp
how to display the excel file content in the jsp  How to present the content of the newly created excel file in the following jsp to the web browser: print("code sample"); <%@ page import="java.io.InputStream" %>
how to upload multiple files in jsp and saving the path in database and the file in folder
how to upload multiple files in jsp and saving the path in database and the file in folder  how to upload multiple files in jsp and saving the path in database and the file in folder I have created a form for the upload of files
Problem with display of images in applets - Applet
Problem with display of images in applets  Hi all, When I run this program, the appletviewer window is showing no output (i.e. no image). I'm..., this); } } --------------------------------------- Display image in Java Applet
how to display data from jsp file into database
how to display data from jsp file into database  this is a jsp file . look at the line with code-> Statement st=con.createStatement(); in the below example. the error is "cannot convert from java.sql.Statement
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
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?  HELLO SIR, CAN ANYONE HELP ME OUT HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML... HELP ME OUT WITH HOW TO VIEW THE STORED DATA IN XML FILE USING EMPNAME. PLEASE

Ads