Re: trimDirectiveWhitespaces not working

2007-03-06 Thread Tim Funk
trimDirectiveWhitespaces is only applicable at servlet configuration 
time. See $TOMCAT_HOME/conf/web.xml


-Tim

Peik Feng wrote:

Hi,
 I have installed Tomcat 6.0.10 with JRE 1.6.0.

 I tried to set trimDirectiveWhitespaces in page directive but it
doesn't take effect.

 %@ page trimDirectiveWhitespaces=true %

 I also tried to set in jsp-property-group in web.xml also no effect.

 jsp-property-group
   trim-directive-whitespacestrue/trim-directive-whitespaces
 /jsp-property-group



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: trimDirectiveWhitespaces not working

2007-03-06 Thread Rémy Maucherat

On 3/6/07, Tim Funk [EMAIL PROTECTED] wrote:

trimDirectiveWhitespaces is only applicable at servlet configuration
time. See $TOMCAT_HOME/conf/web.xml


There's a new directive and new jsp property which is supposed to do
the same as our trimSpaces (of course, it's far more complicated).
While it is parsed and validated (to pass the TCK), it doesn't seem to
be used.

The user could test the following patch to see what it does:
Index: TextOptimizer.java
===
--- TextOptimizer.java  (revision 513314)
+++ TextOptimizer.java  (working copy)
@@ -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 {
@@ -71,7 +73,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;
}

Rémy

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: trimDirectiveWhitespaces not working

2007-03-06 Thread Tim Funk

D'oh! I had an older copy of the spec without those notes.

-Tim

Rémy Maucherat wrote:

On 3/6/07, Tim Funk [EMAIL PROTECTED] wrote:

trimDirectiveWhitespaces is only applicable at servlet configuration
time. See $TOMCAT_HOME/conf/web.xml


There's a new directive and new jsp property which is supposed to do
the same as our trimSpaces (of course, it's far more complicated).
While it is parsed and validated (to pass the TCK), it doesn't seem to
be used.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: trimDirectiveWhitespaces not working

2007-03-06 Thread Rémy Maucherat

On 3/6/07, Tim Funk [EMAIL PROTECTED] wrote:

D'oh! I had an older copy of the spec without those notes.


It's a very minor issue anyway (trimSpaces doesn't do all that much).

Rémy

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: trimDirectiveWhitespaces not working

2007-03-06 Thread Peik Feng

Hi,

 According to JSP Spec v2.1 (page 122/123):

JSP.3.3.8 Removing whitespaces from template text
Whitespaces in template text of a JSP page are preserved by default (See
SectionJSP.1.3.8, White Space). Unfortunately, this means that unwanted
extraneous whitespaces often make it into the response output.
For example, the following code snippet (where

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: trimDirectiveWhitespaces not working

2007-03-06 Thread Peik Feng

Hi,
 Sorry for the previous incomplete post.

 According to JSP Spec v2.1 (page 122/123), and also page 82-84

#

The trim-directive-whitespaces element is a subelement of jsp-property-group
(See SectionJSP.3.3.1, JSP Property Groups). It has no subelements. Its valid
values aretrue andfalse, and it is disabled (false) by default. Enabling the
trimming of whitespaces can be done by setting the trim-directive-whitespaces
element totrue in the JSP configuration.

Page authors can override the default value through the trimDirective-
Whitespaces attribute of the page directive (see SectionJSP.1.10, Directives).

#

 %@ page trimDirectiveWhitespaces=true % this should work right?


--
Regards,
Peik Feng

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



trimDirectiveWhitespaces not working

2007-03-05 Thread Peik Feng

Hi,
 I have installed Tomcat 6.0.10 with JRE 1.6.0.

 I tried to set trimDirectiveWhitespaces in page directive but it
doesn't take effect.

 %@ page trimDirectiveWhitespaces=true %

 I also tried to set in jsp-property-group in web.xml also no effect.

 jsp-property-group
   trim-directive-whitespacestrue/trim-directive-whitespaces
 /jsp-property-group

 Any help is appreciated.
 Thank you.

--
Regards,
Peik Feng

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]