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

2021-01-14 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-760420468


   @markt-asf @ChristopherSchultz @rmaucher Do we have updates on this issue? 



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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-25 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-698430292


   > 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 `.`
   
   I think the node text comes like this `\n` and this will 
be caught by the BLANK_LINE_PATTERN and thus will later be turned down to 
`\n` after the processing. I assume you are not taking the node correctly.
   
   But on a broader aspect 
   
   ```
   | 
   | Quick Servlet Demo
   | 
   ```
   
   Will produce 
   
   ```
   | 
   | Quick Servlet Demo
   | 
   ```
   



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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-24 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-698430292


   > 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 `.`
   
   I think the node text comes like this `\n` and this will 
be caught by the BLANK_LINE_PATTERN and thus will later be turned down to 
`\n` after the processing. I assume you are not taking the node correctly.
   
   But on a broader aspect 
   
   ```
   | 
   | Quick Servlet Demo
   | 
   ```
   
   Will produce 
   
   ```
   | 
   | Quick Servlet Demo
   | 
   ```
   



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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-22 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-696807874


   @markt-asf 
   
   I am sure you wouldn't be able to test this on proprietary code, because 
that will generate empty outputs/compile-errors after stripping out the 
important lines.
   
   I am attaching the JSP from the tomcat code itself, and the results will be 
quite evident once you use the flag in this PR. 
   
   This is the index.jsp file from the ROOT web application in tomcat's code. 
You can use both the parameters and see the difference they exhibit. Also, do 
make sure to clear out the work folder after testing any of the parameter just 
to clear out the cache. 
   
   ```
   <%--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
   
   http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   --%>
   <%@ page session="false" pageEncoding="UTF-8" contentType="text/html; 
charset=UTF-8" %>
   <%
   java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("");
   request.setAttribute("year", sdf.format(new java.util.Date()));
   request.setAttribute("tomcatUrl", "https://tomcat.apache.org/;);
   request.setAttribute("tomcatDocUrl", "/docs/");
   request.setAttribute("tomcatExamplesUrl", "/examples/");
   %>
   
   
   
   
   <%=request.getServletContext().getServerInfo() %>
   
   
   
   
   
   
   
   
   Home
   Documentation
   Configuration
   Examples
   https://wiki.apache.org/tomcat/FrontPage;>Wiki
   Mailing Lists
   Find 
Help
   
   
   
   ${pageContext.servletContext.serverInfo}
   
   
   
   If you're seeing this, you've successfully installed 
Tomcat. Congratulations!
   
   
   
   
   Recommended Reading:
   Security Considerations 
How-To
   Manager Application How-To
   Clustering/Session Replication 
How-To
   
   
   
   
   Server Status
   
   
   Manager App
   
   
   Host Manager
   
   
   
   
   
   Developer Quick Start
   
   
   Tomcat 
Setup
   First Web 
Application
   
   
   
   
   Realms 
 AAA
   JDBC 
DataSources
   
   
   
   
   Examples
   
   
   
   
   https://wiki.apache.org/tomcat/Specifications;>Servlet 
Specifications
   https://wiki.apache.org/tomcat/TomcatVersions;>Tomcat Versions
   
   
   
   
   
   
   
   Managing Tomcat
   For security, access to the manager webapp is restricted.
   Users are defined in:
   $CATALINA_HOME/conf/tomcat-users.xml
   In Tomcat 10.0 access to the manager application 
is split between
  different users.  Read more...
   
   Release Notes
   Changelog
   Migration 
Guide
   Security 
Notices
   
   
   
   
   Documentation
   Tomcat 10.0 

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

2020-09-22 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-696807874


   @markt-asf 
   
   I am sure you wouldn't be able to test this on proprietary code, because 
that will generate empty outputs/compile-errors after stripping out the 
important lines.
   
   I am attaching the JSP from the tomcat code itself, and the results will be 
quite evident once you use the flag in this PR. 
   
   This is the index.jsp file from the ROOT web application in tomcat's code. 
You can use both the parameters and see the difference they exhibit. Also, do 
make sure to clear out the work folder after testing any of the parameter just 
to clear out the cache. 
   
   ```
   <%--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
   
   http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   --%>
   <%@ page session="false" pageEncoding="UTF-8" contentType="text/html; 
charset=UTF-8" %>
   <%
   java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("");
   request.setAttribute("year", sdf.format(new java.util.Date()));
   request.setAttribute("tomcatUrl", "https://tomcat.apache.org/;);
   request.setAttribute("tomcatDocUrl", "/docs/");
   request.setAttribute("tomcatExamplesUrl", "/examples/");
   %>
   
   
   
   
   <%=request.getServletContext().getServerInfo() %>
   
   
   
   
   
   
   
   
   Home
   Documentation
   Configuration
   Examples
   https://wiki.apache.org/tomcat/FrontPage;>Wiki
   Mailing Lists
   Find 
Help
   
   
   
   ${pageContext.servletContext.serverInfo}
   
   
   
   If you're seeing this, you've successfully installed 
Tomcat. Congratulations!
   
   
   
   
   Recommended Reading:
   Security Considerations 
How-To
   Manager Application How-To
   Clustering/Session Replication 
How-To
   
   
   
   
   Server Status
   
   
   Manager App
   
   
   Host Manager
   
   
   
   
   
   Developer Quick Start
   
   
   Tomcat 
Setup
   First Web 
Application
   
   
   
   
   Realms 
 AAA
   JDBC 
DataSources
   
   
   
   
   Examples
   
   
   
   
   https://wiki.apache.org/tomcat/Specifications;>Servlet 
Specifications
   https://wiki.apache.org/tomcat/TomcatVersions;>Tomcat Versions
   
   
   
   
   
   
   
   Managing Tomcat
   For security, access to the manager webapp is restricted.
   Users are defined in:
   $CATALINA_HOME/conf/tomcat-users.xml
   In Tomcat 10.0 access to the manager application 
is split between
  different users.  Read more...
   
   Release Notes
   Changelog
   Migration 
Guide
   Security 
Notices
   
   
   
   
   Documentation
   Tomcat 10.0 

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

2020-09-21 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-696193669







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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-21 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-696211325


   @markt-asf is this the jsp after the modifications? If not, can you attach 
your modified file ? 
   Also, I know trimSpaces touches the empty output files/blank pages, but had 
there been any data in that it wouldn't have touched it... 
   There is a thread in this PR, I just tagged you in that. 
   TrimSpaces only solves particular cases. This parameter solves all that 
trimSpaces solves plus the extra things added on top of those.



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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-21 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-696193669


   @markt-asf  Can you attach what was your JSP when you tested this feature? 



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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-18 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-695044633


   > 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} 
id="${feature.featureName}-module-error" style="display: 
 > none;">${module.moduleError}id="${feature.featureName}-view-model" style="display: 
 > none;">${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 wer
 e mentioned. Reply to this email directly, view it on GitHub <[#351 
(comment)](https://github.com/apache/tomcat/pull/351#issuecomment-694997270)>, 
or unsubscribe 

 .
   
   GZIP compression is good for interleaved whitespace (90+%), however good is 
neither free nor complete (100%).



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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-18 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-694997270


   ```
   <%@ 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.



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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-18 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-694991720


   ```
   <%@ 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.



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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-18 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-694967799


   The primary aim of this PR is to trim off the white spaces. I can give you 
an example here. 
   
   Optimized
   ```
     | 
   -- | --
     | 
     | Quick Servlet Demo
     | 
     | 
     | Tomcat 9 Test app
     | This has over 1000 Jar Files
     | FastStartup Flag: true
     | OptimizeJSPs Flag: true
     | To see server Logs: Click Here
     | To see Optimized Render times of tags: Click Here
     | 
     | 
   ```
   Unoptimized:
   
   ```
   
   --
     | 
     | Quick Servlet Demo
     | 
     | 
     | Tomcat 9 Test app
     | This has over 1000 Jar Files
     |  
     | FastStartup Flag: false
     | OptimizeJSPs Flag: false
     | To see server Logs: Click 
Here
     | To see Optimized Render times of tags: Click Here
     |  
     |  
     |  
     |  
     |  
     |  
     | 
     | 
   ```
   
   For large JSP files these white spaces are tremendous and also useless when 
passed over the network. The white spaces are good for readability for the 
user, and are not necessarily needed as source-compiled files. 
   Removing these white spaces result in fewer writes to internal buffers and 
fewer flushes to the network and thus results in lower latency.



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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-18 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-694957263


   @martin-g This PR is also sitting stagnant since a few days now although all 
comments have been resolved. Can you provide some update on this too ? 



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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-09 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-689824792


   @markt-asf @rotty3000 Thanks for your time on this : )
   I have marked all of the conversations as resolved after the latest commits. 
Do we have any more feedback on this PR? 
   



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] kamnani commented on pull request #351: Remove White Spaces from the JSP files

2020-09-02 Thread GitBox


kamnani commented on pull request #351:
URL: https://github.com/apache/tomcat/pull/351#issuecomment-686061378


   @rotty3000 Thanks for the comment. 
   I have added the flag inside the jasper options as mentioned by you. Do we 
need any other change to this PR? 
   



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