I will consider implementing a filter to remove
the empty lines before the <html> tag.

For now I eliminated most of the empty lines by
changing:
<[EMAIL PROTECTED] import="..." %>
<[EMAIL PROTECTED] language="Java" %>
<jsp:include page="foo.jsp" />
<jsp:include page="bar.jsp" />
<jsp:include page="baz.jsp" />

to:

<[EMAIL PROTECTED] import="..." language="Java" %><jsp:include page="foo.jsp" /><jsp:include page="bar.jsp" /><jsp:include page="baz.jsp" />

Ugly, but at least there is one directive per page.

It would be great if the JSP compiler would not output
new lines for lines containing only JSP directives. I
will fill a feature request for this.

I am using IE 6 SP1, so this issue is still not
fixed. Microsfot may not even be aware of it.

Thanks,
Marius

Christopher Schultz wrote:
Marius,

Thanks for all the replies. I did solve the mystery.
IE is indeed a POS.


I told you :)

IE seems
to be scanning for the <html> tag (don't ask why) and
if it does not find it soon enough then it gives up
and treats the file as raw XML. Pretty smart.

Now this is sort of a show stopper for me, unless I
find a way to reduce the empty lines a the top of
a file. Is there a way in Tomcat to prevent the


If you have multiple JSP directives at the tops of your pages, consider putting them onto the same line. For example:

<[EMAIL PROTECTED] import="..." %>
<[EMAIL PROTECTED] language="Java" %>
<jsp:include page="foo.jsp" />
<jsp:include page="bar.jsp" />
<jsp:include page="baz.jsp" />

Maybe change this to:

<[EMAIL PROTECTED] import="..." %><[EMAIL PROTECTED] language="Java" %><jsp:include page="foo.jsp" /><jsp:include page="bar.jsp" /><jsp:include page="baz.jsp" />

Also note that all of your <[EMAIL PROTECTED] ... %> directives can be put together into one directive, which uses less space.

Tomcat really can't be blamed, because you are putting the newlines into the JSP file yourself. The only thing I can think of would be to have Tomcat ignore trailing whitespace on JSP source lines that nothing but a JSP directive or something like <jsp:include>...

You other option might be to create a filter that collapsed multiple consecutive newlines into a single one. This might break some of your page, though.

A few more observation regarding IE. It seems that
once it guessed the type of a page it is caching that
info in memory.


Even better! What version of IE are you using, BTW? I'm wondering if they've finally fixed this in IE 6.0. I still use 5.5 when I view a site that's so broken in Mozilla that I can't make sense of it (which makes me pretty much furious).

-chris



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to