I actually see this a lot, and the amount of
out.write("\r\n");
varies a great deal depending on the servlet container. For example a jsp
that compiles fine with Tomcat failed to compile (at run time) using Resin.
This was only because Resin wrote out so many "out.write("\r\n");" that the
generated .class file was larger then the 64K (or is it 32K?) size limit for
a single method for the JVM. (The infamous unable to compile branch yadda
yadda error msg...)
Why does tomcat put in so many of these statements into the generated
servlet (.class file), html just ignores whitespace and it just increases
the size of the .class file. Or am I missing something?
-Hakan Kilic
-----Original Message-----
From: Justin Ruthenbeck [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2003 2:44 PM
To: Tomcat Users List
Subject: Re: Removing extra white spaces in source
I think I'm reading the original poster's message right in assuming
he means "white space in the generated html," but maybe I'm going
off in a different direction...
At 11:24 AM 10/24/2003, you wrote:
Also, the title is about white space in source, but in the message
he talks about removing white space from generated jsp and
servlet....??
Generated servlet is a .class file and I would be very reluctant to
diddle with the tomcat generated .jsp files. And I dont see the
need to ever mess with those, so I don't think he really means
generated files.
When precompiling JSP files, the generated servlet *source* files
(error$jsp.java in Tomcat 4.0.3, for example) often have large
blocks of code that look like:
// HTML
// begin[file="/x/y/header.jsp";from=(0,46);to=(1,0)]
out.write("\r\n");
// end
This seems to happen when using jsp:include statements. In the
file that the above example was taken from, there are 17 such
blocks all in a row.
When compiled and run, this results in a lot of whitespace in the
generated html which can sometimes screw up the display. I've seen
this before and have always been able to work around it, but it can
be a problem.
There are several code beautifiers around if that is what he is
really looking for.
This won't solve the problem. One would need a way to remove the
multitude of "out.write("\r\n");" statements in the generated jsps.
justin
Shapira, Yoav wrote:
Howdy,
It simple: what does he mean by "extra" white space? White space
at the
end of a line? White space preceding text? White space in the
middle
of words? This is a text-processing problem. Depending on the
requirements, writing such a text processors can be trivial or
highly
complex.
Yoav Shapira
Millennium ChemInformatics
-----Original Message-----
From: Oscar Carrillo [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2003 12:52 PM
To: Tomcat Users List
Subject: RE: Removing extra white spaces in source
Whatdoyoumean?
On Fri, 24 Oct 2003, Shapira, Yoav wrote:
Howdy,
That depends on the definition of "extra" ;)
Yoav Shapira
Millennium ChemInformatics
-----Original Message-----
From: Luiz Ricardo [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2003 1:51 PM
To: Tomcat-Users List
Subject: Removing extra white spaces in source
Hi everyone,
I would like to know if someone here knows some filter that removes
extra white spaces from content generated by servlet or jsp.
Luiz Ricardo
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged. This e-mail is intended only for
the
individual(s) to whom it is addressed, and may not be saved,
copied,
printed, disclosed or used by anyone else. If you are not the(an)
intended
recipient, please immediately delete this e-mail from your computer
system
and notify the sender. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged. This e-mail is intended only for
the individual(s) to whom it is addressed, and may not be saved,
copied, printed, disclosed or used by anyone else. If you are not
the(an) intended recipient, please immediately delete this e-mail
from your computer system and notify the sender. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
--
*******************************************
* Rick Roberts *
* Advanced Information Technologies, Inc. *
* http://www.ait-web.com *
*******************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
See http://www.nextengine.com/confidentiality.php
____________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]