kokoko12000
Programmer
Hi all,
I am displaying a list of thumbnails which are stored in the database.
I have a JSP file, say a.jsp. I have a while loop in a.jsp file which iterates over the list of thumbnails in the database. In a.jsp, I call for each thumbnail, thumbnail.jsp file for displaying it.
My problem is: Not all thumbnails are being displayed. If I refresh the JSP page, a few of them which displayed the last time are not being displayed and those which did not displayed last time are being displayed. I thought the problem is with buffersize. But tht did not solve my problem.
Could someone throw some light on it.
>>>>>>>>>>> a.jsp <<<<<<<<<<<<<<<<<<,
while(iterate over thumbnails stored in database) {
call thumbnail.jsp to display this thumbnail
}
>>>>>>>>>>>>>>Thumbnail.jsp source:<<<<<<<<<<<<<<<<<
InputStream in = resultset.getBinaryStream() response.reset();
response.setBufferSize(100000);
response.setContentType("image/jpeg"
;
PrintWriter writer = response.getWriter();
int data=0;
while( (data = in.read()) != -1) {
writer.write(data);
}
writer.flush();
writer.close();
response.flushBuffer();
I am displaying a list of thumbnails which are stored in the database.
I have a JSP file, say a.jsp. I have a while loop in a.jsp file which iterates over the list of thumbnails in the database. In a.jsp, I call for each thumbnail, thumbnail.jsp file for displaying it.
My problem is: Not all thumbnails are being displayed. If I refresh the JSP page, a few of them which displayed the last time are not being displayed and those which did not displayed last time are being displayed. I thought the problem is with buffersize. But tht did not solve my problem.
Could someone throw some light on it.
>>>>>>>>>>> a.jsp <<<<<<<<<<<<<<<<<<,
while(iterate over thumbnails stored in database) {
call thumbnail.jsp to display this thumbnail
}
>>>>>>>>>>>>>>Thumbnail.jsp source:<<<<<<<<<<<<<<<<<
InputStream in = resultset.getBinaryStream() response.reset();
response.setBufferSize(100000);
response.setContentType("image/jpeg"
PrintWriter writer = response.getWriter();
int data=0;
while( (data = in.read()) != -1) {
writer.write(data);
}
writer.flush();
writer.close();
response.flushBuffer();