tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Tomcat strips CRLFs from the generated page
Date Tue, 14 Jan 2014 14:49:52 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Asok,

On 1/13/14, 10:28 PM, Asok Chattopadhyay wrote:
> As I said before, I have no control over the input text. In the
> test servlet I am simply reading text from a file and sending it
> out to the browser. No other processing has been done to the text
> by the servlet. The browser, however, receives a page with CRLF
> stripped starting from a certain point in the text. If I View
> source in the browser, I can see that happening.

Some web browsers will re-format the source of the page. Are you sure
you are looking at the "real" text the server is serving? If your HTML
is as atrocious as others claim, perhaps the HTML parser is getting
confused and giving up, allowing the lines to wrap however they want.

Also... who cares about line-wrapping in HTML source? HTML renderers
should ignore whitespace in documents.

> This is consistent over most operating systems (Windows and Linux)
> and most browsers (IE, Firefox and Chrome) and the stripping
> happens exactly at the same point onward, in all combinations of OS
> and browser.
> 
> My question is: who is stripping the CRLF from the text? Is it
> Tomcat or the browser? Is Tomcat doing any validation of the text
> before sending it out to the client?

It sounds like the CR LFs don't exist in the first place, so no
stripping is going on. I requested the .html file you located at
http://workshop.dreamapps.com/da/docs/test.html and there were quite a
few places where lines were quite long (much longer than 80, 120, etc.
characters).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS1U6QAAoJEBzwKT+lPKRYiR0P/RjwK1S1fEr3T7msKBf/ch//
ong40f07s980dIDFJoCryzeldsSWYBT9nBN9G+SKA7jnvMq4VT7OHhh2uPTrXJKq
Y6NCPSxxIoeRJnmiuauPDc7gzKs6w1idtLdl/XaKvYlCBqMEyYwCk7yeaHER4AND
vD1YokP+H5Q/6Ue+eSdqDjyRXM2nvsfjeYtzPAEjKhn1EACdJWC/xXGfZRgrfr2h
nfzdA+U4830X8LUrYl6xoAcONYQoKIYvb+0XUbsnBorErLFd/5kE67SfNh24nM+c
eJpLeELPKwu3YF5bGW5s/PYNBnRsVl4U+r3EM8dHv+Flad2rICr+N3KXie2nF+4g
BtS3yOJn9H0BxRByFfSYPEKsNj6enwKtxmsxRmUeFkndYdYL35h1lQD6v7eX7VpI
wRn8qz0SGHPzHVI9/S3Na7iDiWyjeoC5ciItQu3z1qkxkP2nF1XmX1g89cmlEG4G
+WrBzy1ZILcGV5jc54uFDXTpy7CpCZEeKG1WZgo0U0I02G18kt3L2sFsdjIOraps
KRSG8O9tf3VemasnCnWPuyj8oqIG0fUzEKHhcIjGlKW7rLBMX6C+rk8U+JAjdeiS
sm7ZOQjGGO2/CUprJ1CHerr5jAdV+4gkgyapcf1MfJ3/42/SMpHCbYcujyOjRWyu
/GkoyEhF6YYb8lpTFACS
=iA8s
-----END PGP SIGNATURE-----

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


Mime
View raw message