Hi All,
I have one problem When I write byte[] in to output stream My
servlet is getting submitted twice. Its getting in to doGet() method twice. If I comment os.write(pdf[i]);, Its getting submitted only once. Please help me.
Please see the code below.
private void outputPDF(HttpServletResponse response, byte[] pdf) throws IOException
{
response.setContentType("application/pdf");
log.debug("after getting into the response ");
response.setContentLength(getContentLen(pdf));
response.setDateHeader("Expires",0);
log.debug("after setting the content type and the date");
OutputStream os = response.getOutputStream();
log.debug("PDF Length Value=====" + pdf.length);
for(int i=0;i<pdf.length;i++) {
os.write(pdf[i]);
}
os.close();
}
Regards
Selvan