You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sternath Elmar <el...@siemens.com> on 2003/02/25 10:11:16 UTC

ResourceReader problem

Hello,

I already posted this issue some time ago. Meanwhile, I collected additional information about the error behaviour. The problem is that I would like to download a pdf file by use of ResourceReader. Here is the sitemap entry: 
<map:match pattern="DownloadDocumentById/*">
	<!-- mime-type is not expanded by ResourceReader -->
	<map:select type="request-parameter">
		<map:parameter name="parameter-name" value="DocFormat"/>								<map:when test="application/pdf">
			<map:read mime-type="application/pdf" src="file://C:/elster/pdf.pdf"/>
		</map:when>

The error behaviour is that in IE, the HTTP GET request is sent twice. I analyzed the first HTTP GET response sent by Cocoon and recognized that the pdf binary stream was truncated. Maybe this is the reason why IE sends the second HTTP GET request. On the other hand, Netscape 7 sends only one HTTP GET response and receives only one correct HTTP GET response which is not truncated. I compared the HTTP GET requests of IE and Netscape and the main difference was the User-Agent field entry.
Can anybody out there tell me why Cocoon behaves different dependent on browser usage?? Here are the two HTTP GET requests sent by IE and then the one sent by Netscape:

1. IE:
GET /cocoon/scworkflow/DownloadDocumentById/DocumentView.pdf?DocId=7%200x012d5d61@NETINFO&DocFormat=application/pdf HTTP/1.1 
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */* 
Accept-Language: de 
Accept-Encoding: gzip, deflate 
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461; QXW0334w) 
Host: localhost 
Connection: Keep-Alive 
Cookie: 1046163403983; JSESSIONID=B6F89AEE5C26EC7B3EE9C2A654CB2DAD 

2. IE:
GET /cocoon/scworkflow/DownloadDocumentById/DocumentView.pdf?DocId=7%200x012d5d61@NETINFO&DocFormat=application/pdf HTTP/1.1 
Accept: */* Accept-Encoding: gzip, deflate 
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461; QXW0334w) 
Host: localhost 
Connection: Keep-Alive 
Cookie: 1046163403983; JSESSIONID=B6F89AEE5C26EC7B3EE9C2A654CB2DAD

Netscape:
GET /cocoon/scworkflow/DownloadDocumentById/DocumentView.pdf?DocId=7%200x012d5d61%40NETINFO&DocFormat=application/pdf HTTP/1.1 
Host: localhost 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.0.1) Gecko/20020823 Netscape/7.0 
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1 
Accept-Language: de-de, de;q=0.66, en;q=0.33 
Accept-Encoding: gzip, deflate, compress;q=0.9 
Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66 
Keep-Alive: 300 
Connection: keep-alive 
Referer: http://localhost:8081/cocoon/scworkflow/DocumentList?IdType=Organisation&Id=44&ProductTitle=Marketing&selDocumentCategory=Marketing%20Information&cache=true 
Cookie: 1046163750316; JSESSIONID=2EF0425E3EF495DA87BC14D7A1B82D4A



Mit freundlichen Grüßen/ Best regards
Elmar Sternath

Siemens AG
Information and Communication Networks
ICN IT CA EB 2 - Web Applications
Mch H/Me19 - 99801-231a

Meglinger Straße 19 (99801-231a) D-84577 München
Tel.:   +49(89)722-24045
Mobil: +49(0)160-5860351
Fax.:  +49(89)722-53384
EMail: Elmar.Sternath@siemens.com

 <<Sternath Elmar.vcf>> 

Re: ResourceReader problem

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Sternath Elmar wrote:
> <map:match pattern="DownloadDocumentById/*">
...
> The error behaviour is that in IE, the HTTP GET request is sent twice.
That's probably the same as the IEx architecture bug
causing this FAQ:
  http://xml.apache.org/fop/faq.html#faq-N104A8
I've wrote numerous speculations about the subject
which can be found in the Cocoon and FOP list archives.

If your URL ends in .pdf, it is possible that you hit the old
problem that the MIME type was not sent properly by Cocoon,
however, I think this bug was fixed some time ago, and you
can easily check whether the MIME type was set.

> Can anybody out there tell me why Cocoon behaves different dependent on
> browser usage?? Here are the two HTTP GET requests sent by IE

The browser is responsible for issuing the GETs, not Cocoon.

J.Pietschmann


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org