tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39530] - Tomcat 5.5.17 generates incorrect code with trimSpaces turned on.
Date Fri, 20 Jul 2007 05:10:23 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39530>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39530





------- Additional Comments From cowan@aconex.com  2007-07-19 22:10 -------
This also applies to EL expressions. e.g. the JSP code

<h1>${a} ${b}</h1>

produces the Java:

out.write("<h1>");
out.write((java.lang.String)
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${a}",
java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write((java.lang.String)
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${b}",
java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</h1>");

which is clearly not correct.

I would suggest 2 options here:

1) Whitespace around any 'expression', whether EL ${} or JSP <%= %> should count
as 'significant', as Andrew has suggested above.

2) Optionally, and additionally rather than removing all this whitespace,
collapse it into one (html-significant) space. This would address the fact that,
say, 
<% out.write("a"); %>             <% out.write("b"); %>
would produce (to the end user, after the browser collapses spaces per normal)
"a b" with trimspaces off, but "ab" with it on. Collapsing n whitespaces -> 1
possibly makes more sense than n -> 0 (at least as an option).

I'm less worried about #2, but #1 certainly seems to be a bug to me.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message