Closed Bug 142747 Opened 22 years ago Closed 22 years ago

Setting the response content type in a jsp to application/pdf shows only an empty page.

Categories

(Core Graveyard :: Plug-ins, defect, P3)

x86
Windows 2000
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME
mozilla1.2alpha

People

(Reporter: ralf, Assigned: serhunt)

Details

Attachments

(1 file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc1)
Gecko/20020417
BuildID:    2002041711

If I set the content type of the response object in a jsp to application/pdf and
send a pdf through the response's outputstream, mozilla starts the acrobat
plugin but does not display any content.
The same jsp worked with the 0.9.9 release of mozilla.

Reproducible: Always
Steps to Reproduce:
1.response.setContentType("application/pdf");
2.response.setContentLength(result.length);
3.response.getOutputStream().write(result); // result is byte[]
4.response.getOutputStream().flush();

Actual Results:  Acrobat plugin is loaded but neither the plugin nor any other
content appears on the page.

Expected Results:  Acrobat plugin appears and displays the pdf.

Clicking on a link to a PDF works as one might expect it.
Is there a publicly accessible link where this could be tested, by chance?
The important part is at the bottom of the file: SupplierProfile.jsp
It is loaded for a first time to display a form, the form is submittet and the
same page reloads, checks for the conditional whether a pdf was requested and
if so uses a <jsp:forward page="./SupplierProfilePDF.jsp"> that serves the
generated PDF.
>>> Is there a publicly accessible link where this could be tested, by
>>> chance?

>> No, I am sorry. But I could send you the code.
>>
>> Until now I encountered some situations in which mozilla would not load
>> a pdf through a link to a static file, too. But I am not sure if it was
>> a side effect from my tests with the jsp.
>>
>> I forgot to mention: The JSP is run in the debug environment of Oracle
>> JDeveloper 3.2.3. If this makes any difference.
>>

> Hmm...  Could you perhaps do the following?
> export NSPR_LOG_MODULES="nsHttp:5"
> export NSPR_LOG_FILE=/tmp/logfile.txt

OK, I attached the dump to the bug.
Ralf, how big is the PDF?  Is the "Content-Length: 4213" correct?
Yes, that is the length of the byte array.
to plugins as a first guess... no idea what could be going wrong here.
Assignee: Matti → beppe
Status: UNCONFIRMED → NEW
Component: Browser-General → Plug-ins
Ever confirmed: true
QA Contact: imajes-qa → shrir
assigning to av and adding liz

Liz: any ideas?
Assignee: beppe → av
Priority: -- → P3
Target Milestone: --- → mozilla1.2alpha
The problem disappeared with release candidate 2!
Great.  :)
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: