kamnani commented on a change in pull request #351:
URL: https://github.com/apache/tomcat/pull/351#discussion_r482622880



##########
File path: java/org/apache/jasper/EmbeddedServletOptions.java
##########
@@ -635,6 +648,19 @@ public EmbeddedServletOptions(ServletConfig config, 
ServletContext context) {
             }
         }
 
+        String jspWhiteSpaceTrim = 
config.getInitParameter("JSPWhiteSpaceTrimming");
+        if (jspWhiteSpaceTrim != null) {
+            if (jspWhiteSpaceTrim.equalsIgnoreCase("true")) {
+                this.JSPWhiteSpaceTrimming  = true;
+            } else if (jspWhiteSpaceTrim.equalsIgnoreCase("false")) {
+                this.JSPWhiteSpaceTrimming  = false;
+            } else {
+                if (log.isWarnEnabled()) {
+                    log.warn(Localizer.getMessage("Invalid Value for the 
flag"));

Review comment:
       Yes, I think we can add the name of the flag. That can be done. 

##########
File path: java/org/apache/jasper/compiler/Generator.java
##########
@@ -81,6 +83,13 @@
 
     private static final Class<?>[] OBJECT_CLASS = { Object.class };
 
+    //context param to enable or disable the excess white space trimming.
+    private static final String JSP_WHITE_SPACE_TRIMMING = 
"JSPWhiteSpaceTrimming";
+
+    private static final Pattern PRE_TAG_PATTERN = 
Pattern.compile("(?s).*(<pre>|</pre>).*");
+
+    private static final Pattern BLANK_LINE_PATTERN = 
Pattern.compile("(\\s*(\\n|\\r)+\\s*)");

Review comment:
       I think we need input here, if we should add another webapp - for 
testing this change. 




----------------------------------------------------------------
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

Reply via email to