[GitHub] [tomcat] martin-g commented on pull request #351: Remove White Spaces from the JSP files

2020-09-25 Thread GitBox


martin-g commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-698157237


   Since there is no new test for this I am not sure but looking at the code I 
think "Remove white space" is not quite accurate.
   It is rather "Remove empty lines". Because BLANK_LINE_PATTERN would match 
only if there zero or more empty spaces, followed by at least one new line, 
followed by 0 or more empty spaces.
   So the example above:
   
   ```
   | 
   | Quick Servlet Demo
   | 
   ```
   
   won't produce:
   ```
   |
   | Quick Servlet Demo
   | 
   ```
   
   In addition: why preserve 1 new line ? HTML minifiers would produce 
something like `.`



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[GitHub] [tomcat] martin-g commented on pull request #351: Remove White Spaces from the JSP files

2020-09-24 Thread GitBox


martin-g commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-698157237


   Since there is no new test for this I am not sure but looking at the code I 
think "Remove white space" is not quite accurate.
   It is rather "Remove empty lines". Because BLANK_LINE_PATTERN would match 
only if there zero or more empty spaces, followed by at least one new line, 
followed by 0 or more empty spaces.
   So the example above:
   
   ```
   | 
   | Quick Servlet Demo
   | 
   ```
   
   won't produce:
   ```
   |
   | Quick Servlet Demo
   | 
   ```
   
   In addition: why preserve 1 new line ? HTML minifiers would produce 
something like `.`



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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



[GitHub] [tomcat] martin-g commented on pull request #351: Remove White Spaces from the JSP files

2020-09-18 Thread GitBox


martin-g commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-695042633


   Have you considered using gzip compression for such big responses?
   It'd help much better that the white space stripping.
   
   On Fri, Sep 18, 2020, 20:39 kamnani  wrote:
   
   > <%@ taglib uri="http://java.sun.com/jsp/jstl/core; prefix="c"%>
   > <%@ taglib uri="http://java.sun.com/jsp/jstl/functions; prefix="fn" %>
   >
   > 
   >
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   >
   > ${feature.featureName}:jsp-exec-time
   >
   > 
   > <%-- PLEASE ENSURE ANY CHANGES MADE HERE ARE KEPT IN SYNC WITH 
/WEB-INF/views/jsp/ajax/.jsp --%>
   >
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > ${module.content}
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > 
   > ${feature.content}
   > 
   > 
   > 
   > ${feature.content}
   > 
   >
   > 
   > 
   >
   > <%@ include file="criticalFeatureLogging.jsp" %>
   >
   > 
   >
   > 
   > 
   > 
   > 
   > 
   > 
   >
   > 
   > 
   > 
   > ${jspError}
   > 
   > 
   > 
   > ${module.moduleError}
   > 
   > 
   > ${requestScope[feature.featureName]}
   > 
   > 
   > 
   > 
   > 
   > 
   >
   > <%@ include 
file="/WEB-INF/views/jsp/features/debug/includeIsDebugJs.jsp" %>
   > 
   >
   > 
   >
   >
   >1. This is from a real file in a critical application but we
   >stripped(or even marked ***) out certain proprietary lines. If there is 
an
   >error or such that's why.
   >2. The indented tags such as line 12 results in white space on the
   >html output. This white space is eliminated via this change.
   >3. Our application is filled with neatly-formatted JSPs that output
   >waste such as that. One public-facing HTML page became 20% smaller after
   >implementing this.
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > , or
   > unsubscribe
   > 

   > .
   >
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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