Hi,
        My requirement is fetching the pdf files which are stored in the database
as BLOB objects and display it. For That I have xxxxx.jsp on which I will
display the links to different pdf files that are to be fetched from the
database and display.
        On the click of each link, I will pass a parameter to a query and fetch the
binary stream of the pdf file from the database and push it in to a
inputstream object. This inputstream object is accessed in the xxx.jsp.
        For displaying the pdf files, I have written this xxx.jsp. But I am having
several problems in the process.
The following is the code for xxx.jsp


<%@ page language="java" import="java.util.*,java.io.*"
contentType="application/pdf ; charset=ISO-8859-1" %>
<%@ page buffer="32k" errorPage="/error/errorpage.jsp" %>

<jsp:useBean id="cisbean" scope="request" class="com.nqb.ps.bean.XxxBean">

<jsp:setProperty
        name="xxxbean"
        property="allPropsSet"
        value=""
/>

</jsp:useBean>

<html>
<head>
<title>Financial Report</title>
</head>
<%
    response.setHeader ("Content-Disposition", "attachment;
filename="Example.pdf"");
    xxxbean.setXxxText(request.getParameter("headline"));
    InputStream in = xxxbean.getXxxText();

    int bit = 256;
    int i = 0;

    try {
        while((bit) >= 0) {
            bit = in.read();
            out.write(bit);
        }
    } catch (IOException ioe) {
        ioe.printStackTrace(System.out);
    }
    out.flush();
%>
</html>


The problems I am getting are :

1. The above code works fine with beyond IE 6.0 versions of the browser and
Netscape 6.1 versions.

2. The problem here with versions below IE 6.0 -- >  prompting two
open-save dialog boxes. first one for xxxxx.jsp and after that it opens the
open-save dialog box for xxx.jsp.

3. With Netscape versions below 6.1 -- > It's not workig at all.

If I change Content-Dispostion to "inline"

1. It's working fine with all IE versions with Acrobat Reader 4.0 but not
with Acrobat Reader 5.0

2. It's working fine with Netscape versions beyond 6.1 with both Acrobat
Reader 4.0 and 5.0, But not working with Netscape versions below 6.1




Any suggestions or pointers would be greatly appreciated.

Please tell me the right mailing group to post this question.

Thanks,

Dinesh

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to