tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marius Scurtescu <mari...@lightspeed.ca>
Subject Re: xhtml and Internet Explorer
Date Thu, 30 Oct 2003 23:50:48 GMT
JSP is a templating language which is using a meta
language: the JSP constructs.

The new line is in the JSP indeed, but is it part
of the meta language or part of the literal output?
I would argue that these new lines are part of the
meta language and that they should not be output.
You put them there so the meta language you use is
readable.

See how FreeMarker, another templating language,
is dealing with this issue:
http://freemarker.sourceforge.net/docs/dgui_misc_whitespace.html#dgui_misc_whitespace_stripping

You are not asking the directive to scan anything,
the page compiler could consider white space and newlines
after a directive as part of that directive.

Marius

Adam Hardy wrote:

> On 10/30/2003 10:08 PM Marius Scurtescu wrote:
> 
>> 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:
>> <%@page import="..." %>
>> <%@page language="Java" %>
>> <jsp:include page="foo.jsp" />
>> <jsp:include page="bar.jsp" />
>> <jsp:include page="baz.jsp" />
>>
>> to:
>>
>> <%@page 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 doubt you will get far with such a feature request. If you consider 
> what the JSP is doing, you'll see it's only doing it's job. The new line 
> is in the JSP!
> 
> It's nothing to do with the tag / page directive. Asking the tag or page 
> directive not to output a new line afterwards is like asking it to scan 
> ahead in the JSP to determine what comes next, and if it's a new line, 
> please delete it.
> 
> Adam
> 



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


Mime
View raw message