You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thomas Schmidt <t....@sh-home.de> on 2003/05/09 20:41:32 UTC

Re: garbage in Coyote's HTTP output ?! - sorry for the disformated email

t.schmidt wrote:

sorry - for this disformated email !

here it is - i hope in a good format ..




i've here a construction with a servlet that calls the saxon stylesheet 
parser,
to generate HTML from XML/XSL or PDF from XML/XSL/FOP (apache fop parser 
is called
then from saxon to generate PDF). the client side under 
linux/mozilla/xpdf it
runs nice, but under windows/IE/acroread(plugin) it says, when you call 
PDF generation,
"PDF file doesnt begin with %PDF-" and shows a white page.

.. ok i traced the HTTP session with ethereal - and realy there is some 
garbage
between HTTP Headers and data. First i thought that this garbage comes 
from my
servlet/stylesheet parsers but it's also present when you call the 
Tomcat /index.jsp page.
In the Servlet examples are not such characters ...


Here are some examples:


1th a from XML/XSL generated HTML output:

-.-.-.-.-.-.-.-.- schnipp -.-.-.-.-.-.-.-.-
GET /clusterdoc/cluster-doc.xml HTTP/1.1 Accept: image/gif, 
image/x-xbitmap,
image/jpeg, image/pjpeg, application/vnd.ms -excel, application/msword,
application/x-shockwave-flash, */*
Referer: http://scxw15.4sc:8080/clusterdoc/
Accept-Language: en,de;q=0.5
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: scxw15.4sc:8080
Connection: Keep-Alive


HTTP/1.1 200 OK
Content-Type: text/html
Transfer-Encoding: chunked
Date: Fri, 09 May 2003 16:55:46 GMT
Server: Apache Coyote/1.0

2000
<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
"http://www.w3.org/TR/REC-html
40/loose.dtd">
<HTML>

 <HEAD>


[....CUT....]


-^-^-^-^-^-^-^-^- schnapp -^-^-^-^-^-^-^-^-

Please look at the "2000" between "Server: Apache Coyote/1.0" and 
"<!DOCTYPE html .." that 4 chars shouldnt be there .. the HTML 
interpreter doesn't care about but the acroreader does ...



2nd a from XML/XSL/FOP generated PDF output:

-.-.-.-.-.-.-.-.- schnipp -.-.-.-.-.-.-.-.-

GET /clusterdoc/cluster-doc.xml?style=system/xsl/docu/docu.pdf.xsl HTTP/1.1

[....CUT....]

HTTP/1.1 200 OK
Content-Type: application/pdf
Transfer-Encoding: chunked
Date: Fri, 09 May 2003 16:56:45 GMT
Server: Apache Coyote/1.0

2000
%PDF-1.3
%ª«¬­
4 0 obj
<< /Type /Info

[....CUT....]

-^-^-^-^-^-^-^-^- schnapp -^-^-^-^-^-^-^-^-

also here is a "2000" between "Server: Apache Coyote/1.0" and "%PDF-1.3"



and 3th the Tomcat /index.jsp page:

-.-.-.-.-.-.-.-.- schnipp -.-.-.-.-.-.-.-.-

GET /index.jsp HTTP/1.1

[....CUT....]

Server: Apache Coyote/1.0

2000

<!doctype html public "-//w3c//dtd html 4.0 transitional//en" 
"http://www.w3.or
g/TR/REC-html40/strict.dtd">
<html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <title>Apache Tomcat/4.1.18</title>

[....CUT....]

-^-^-^-^-^-^-^-^- schnapp -^-^-^-^-^-^-^-^-

and here also ...



please note that there mustn't be always a "2000" - there could be also
other chars - but when i captured this examples it always contained 
"2000" (strange ...) i think that this chars represents a HEX value - 
cause i've never seen chars higher than "f".  i cant imagine what this 
value could represent ...

I use Tomcat Version 4.1.24 - (bin),
Linux RH 7.3 , (JRE) J2SDK 1.4.1 i586.




i'm sorry to send this eMail twice ...

regards && thx Thomas









Re: garbage in Coyote's HTTP output ?! - sorry for the disformated email

Posted by Bill Barker <wb...@wilshire.com>.
If you don't want chunked encoding, then you have to set the content-length
by calling response.setContentLength.

"Tim Funk" <fu...@joedog.org> wrote in message
news:3EBBF999.4070106@joedog.org...
> You are using chunked encoding. The 2000 is the number of bytes the next
> chunk size is.
>
> -Tim
>
> Thomas Schmidt wrote:
> > t.schmidt wrote:
> >
> > sorry - for this disformated email !
> >
> > here it is - i hope in a good format ..
> >
> >
> >
> >
> > i've here a construction with a servlet that calls the saxon stylesheet
> > parser,
> > to generate HTML from XML/XSL or PDF from XML/XSL/FOP (apache fop parser
> > is called
> > then from saxon to generate PDF). the client side under
> > linux/mozilla/xpdf it
> > runs nice, but under windows/IE/acroread(plugin) it says, when you call
> > PDF generation,
> > "PDF file doesnt begin with %PDF-" and shows a white page.
> >
> > .. ok i traced the HTTP session with ethereal - and realy there is some
> > garbage
> > between HTTP Headers and data. First i thought that this garbage comes
> > from my
> > servlet/stylesheet parsers but it's also present when you call the
> > Tomcat /index.jsp page.
> > In the Servlet examples are not such characters ...
> >
> >
> > Here are some examples:
> >
> >
> > 1th a from XML/XSL generated HTML output:
> >
> > -.-.-.-.-.-.-.-.- schnipp -.-.-.-.-.-.-.-.-
> > GET /clusterdoc/cluster-doc.xml HTTP/1.1 Accept: image/gif,
> > image/x-xbitmap,
> > image/jpeg, image/pjpeg, application/vnd.ms -excel, application/msword,
> > application/x-shockwave-flash, */*
> > Referer: http://scxw15.4sc:8080/clusterdoc/
> > Accept-Language: en,de;q=0.5
> > Accept-Encoding: gzip, deflate
> > User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
> > Host: scxw15.4sc:8080
> > Connection: Keep-Alive
> >
> >
> > HTTP/1.1 200 OK
> > Content-Type: text/html
> > Transfer-Encoding: chunked
> > Date: Fri, 09 May 2003 16:55:46 GMT
> > Server: Apache Coyote/1.0
> >
> > 2000
> > <!DOCTYPE html
> > PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
> > "http://www.w3.org/TR/REC-html
> > 40/loose.dtd">
> > <HTML>
> >
> > <HEAD>
> >
> >
> > [....CUT....]
> >
> >
> > -^-^-^-^-^-^-^-^- schnapp -^-^-^-^-^-^-^-^-
> >
> > Please look at the "2000" between "Server: Apache Coyote/1.0" and
> > "<!DOCTYPE html .." that 4 chars shouldnt be there .. the HTML
> > interpreter doesn't care about but the acroreader does ...
> >
> >
> >
> > 2nd a from XML/XSL/FOP generated PDF output:
> >
> > -.-.-.-.-.-.-.-.- schnipp -.-.-.-.-.-.-.-.-
> >
> > GET /clusterdoc/cluster-doc.xml?style=system/xsl/docu/docu.pdf.xsl
HTTP/1.1
> >
> > [....CUT....]
> >
> > HTTP/1.1 200 OK
> > Content-Type: application/pdf
> > Transfer-Encoding: chunked
> > Date: Fri, 09 May 2003 16:56:45 GMT
> > Server: Apache Coyote/1.0
> >
> > 2000
> > %PDF-1.3
> > %����
> > 4 0 obj
> > << /Type /Info
> >
> > [....CUT....]
> >
> > -^-^-^-^-^-^-^-^- schnapp -^-^-^-^-^-^-^-^-
> >
> > also here is a "2000" between "Server: Apache Coyote/1.0" and "%PDF-1.3"
> >
> >
> >
> > and 3th the Tomcat /index.jsp page:
> >
> > -.-.-.-.-.-.-.-.- schnipp -.-.-.-.-.-.-.-.-
> >
> > GET /index.jsp HTTP/1.1
> >
> > [....CUT....]
> >
> > Server: Apache Coyote/1.0
> >
> > 2000
> >
> > <!doctype html public "-//w3c//dtd html 4.0 transitional//en"
> > "http://www.w3.or
> > g/TR/REC-html40/strict.dtd">
> > <html>
> >  <head>
> >  <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
> >  <title>Apache Tomcat/4.1.18</title>
> >
> > [....CUT....]
> >
> > -^-^-^-^-^-^-^-^- schnapp -^-^-^-^-^-^-^-^-
> >
> > and here also ...
> >
> >
> >
> > please note that there mustn't be always a "2000" - there could be also
> > other chars - but when i captured this examples it always contained
> > "2000" (strange ...) i think that this chars represents a HEX value -
> > cause i've never seen chars higher than "f".  i cant imagine what this
> > value could represent ...
> >
> > I use Tomcat Version 4.1.24 - (bin),
> > Linux RH 7.3 , (JRE) J2SDK 1.4.1 i586.
> >
> >
> >
> >
> > i'm sorry to send this eMail twice ...
> >
> > regards && thx Thomas
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: garbage in Coyote's HTTP output ?! - sorry for the disformated email

Posted by Tim Funk <fu...@joedog.org>.
You are using chunked encoding. The 2000 is the number of bytes the next 
chunk size is.

-Tim

Thomas Schmidt wrote:
> t.schmidt wrote:
> 
> sorry - for this disformated email !
> 
> here it is - i hope in a good format ..
> 
> 
> 
> 
> i've here a construction with a servlet that calls the saxon stylesheet 
> parser,
> to generate HTML from XML/XSL or PDF from XML/XSL/FOP (apache fop parser 
> is called
> then from saxon to generate PDF). the client side under 
> linux/mozilla/xpdf it
> runs nice, but under windows/IE/acroread(plugin) it says, when you call 
> PDF generation,
> "PDF file doesnt begin with %PDF-" and shows a white page.
> 
> .. ok i traced the HTTP session with ethereal - and realy there is some 
> garbage
> between HTTP Headers and data. First i thought that this garbage comes 
> from my
> servlet/stylesheet parsers but it's also present when you call the 
> Tomcat /index.jsp page.
> In the Servlet examples are not such characters ...
> 
> 
> Here are some examples:
> 
> 
> 1th a from XML/XSL generated HTML output:
> 
> -.-.-.-.-.-.-.-.- schnipp -.-.-.-.-.-.-.-.-
> GET /clusterdoc/cluster-doc.xml HTTP/1.1 Accept: image/gif, 
> image/x-xbitmap,
> image/jpeg, image/pjpeg, application/vnd.ms -excel, application/msword,
> application/x-shockwave-flash, */*
> Referer: http://scxw15.4sc:8080/clusterdoc/
> Accept-Language: en,de;q=0.5
> Accept-Encoding: gzip, deflate
> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
> Host: scxw15.4sc:8080
> Connection: Keep-Alive
> 
> 
> HTTP/1.1 200 OK
> Content-Type: text/html
> Transfer-Encoding: chunked
> Date: Fri, 09 May 2003 16:55:46 GMT
> Server: Apache Coyote/1.0
> 
> 2000
> <!DOCTYPE html
> PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
> "http://www.w3.org/TR/REC-html
> 40/loose.dtd">
> <HTML>
> 
> <HEAD>
> 
> 
> [....CUT....]
> 
> 
> -^-^-^-^-^-^-^-^- schnapp -^-^-^-^-^-^-^-^-
> 
> Please look at the "2000" between "Server: Apache Coyote/1.0" and 
> "<!DOCTYPE html .." that 4 chars shouldnt be there .. the HTML 
> interpreter doesn't care about but the acroreader does ...
> 
> 
> 
> 2nd a from XML/XSL/FOP generated PDF output:
> 
> -.-.-.-.-.-.-.-.- schnipp -.-.-.-.-.-.-.-.-
> 
> GET /clusterdoc/cluster-doc.xml?style=system/xsl/docu/docu.pdf.xsl HTTP/1.1
> 
> [....CUT....]
> 
> HTTP/1.1 200 OK
> Content-Type: application/pdf
> Transfer-Encoding: chunked
> Date: Fri, 09 May 2003 16:56:45 GMT
> Server: Apache Coyote/1.0
> 
> 2000
> %PDF-1.3
> %ª«¬­
> 4 0 obj
> << /Type /Info
> 
> [....CUT....]
> 
> -^-^-^-^-^-^-^-^- schnapp -^-^-^-^-^-^-^-^-
> 
> also here is a "2000" between "Server: Apache Coyote/1.0" and "%PDF-1.3"
> 
> 
> 
> and 3th the Tomcat /index.jsp page:
> 
> -.-.-.-.-.-.-.-.- schnipp -.-.-.-.-.-.-.-.-
> 
> GET /index.jsp HTTP/1.1
> 
> [....CUT....]
> 
> Server: Apache Coyote/1.0
> 
> 2000
> 
> <!doctype html public "-//w3c//dtd html 4.0 transitional//en" 
> "http://www.w3.or
> g/TR/REC-html40/strict.dtd">
> <html>
>  <head>
>  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
>  <title>Apache Tomcat/4.1.18</title>
> 
> [....CUT....]
> 
> -^-^-^-^-^-^-^-^- schnapp -^-^-^-^-^-^-^-^-
> 
> and here also ...
> 
> 
> 
> please note that there mustn't be always a "2000" - there could be also
> other chars - but when i captured this examples it always contained 
> "2000" (strange ...) i think that this chars represents a HEX value - 
> cause i've never seen chars higher than "f".  i cant imagine what this 
> value could represent ...
> 
> I use Tomcat Version 4.1.24 - (bin),
> Linux RH 7.3 , (JRE) J2SDK 1.4.1 i586.
> 
> 
> 
> 
> i'm sorry to send this eMail twice ...
> 
> regards && thx Thomas
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org