Author: remm
Date: Thu Mar 8 07:52:15 2007
New Revision: 516081
URL: http://svn.apache.org/viewvc?view=rev&rev=516081
Log:
- Use the trim property and trim directive, which should be equivalent to
Jasper's own attribute.
Modified:
tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/TextOptimizer.java
Modified:
tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/TextOptimizer.java
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/TextOptimizer.java?view=diff&rev=516081&r1=516080&r2=516081
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/TextOptimizer.java
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/TextOptimizer.java Thu
Mar 8 07:52:15 2007
@@ -29,6 +29,7 @@
static class TextCatVisitor extends Node.Visitor {
private Options options;
+ private PageInfo pageInfo;
private int textNodeCount = 0;
private Node.TemplateText firstTextNode = null;
private StringBuffer textBuffer;
@@ -36,6 +37,7 @@
public TextCatVisitor(Compiler compiler) {
options = compiler.getCompilationContext().getOptions();
+ pageInfo = compiler.getPageInfo();
}
public void doVisit(Node n) throws JasperException {
@@ -70,8 +72,8 @@
}
public void visit(Node.TemplateText n) throws JasperException {
-
- if (options.getTrimSpaces() && n.isAllSpace()) {
+ if ((options.getTrimSpaces() ||
pageInfo.isTrimDirectiveWhitespaces())
+ && n.isAllSpace()) {
n.setText(emptyText);
return;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]