tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Asok Chattopadhyay <>
Subject Tomcat strips CRLFs from the generated page
Date Mon, 13 Jan 2014 11:09:08 GMT

My servlet generates a page containing embedded JavaScript and sometimes
the page received in the browser comes with CRLFs stripped from the text,
starting at some point in the text. This creates a big problem if the
script contains CRLF as statement separator instead of semi-colon. It's
strange that not the entire text is stripped. Say, the first 150 lines
comes as it is, whereas starting from line 151, all the CRLFs are stripped.
It is fairly consistent for the same page.

I am using Tomcat 6.0.37.

Why does it happen? Is anything in the text triggers this? Is there a way
to overcome this problem, as I don't have control over the actual content?

Thanks in advance.

Here is the example.

LINE 148:    <script type="text/javascript"

LINE 149:    <script type="text/javascript"

LINE 150:    <script type="text/javascript"

LINE 151:    <script type="text/javascript"
SRC="html/scripts/calc.js"></script>    <script type="text/javascript"
SRC="html/scripts/dream.js"></script><script language="javascript"
type="text/javascript">var buttonfunction
clicked(b){button=b.value}function submitit(form){if
(button=="Details"){ = "opcdt"form.searchbutton.value =
"Top"}}function pickProduct(link, cus){if
(navigator.appName.indexOf("Netscape") >=
style="margin:0;padding:0;"><!--<div id="darkBackgroundLayer"
class="darkenBackground"> ...

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message