users@glassfish.java.net

trimDirectiveWhitespaces is not working as it should

From: <glassfish_at_javadesktop.org>
Date: Tue, 12 May 2009 09:52:19 PDT

Hello,

I tried: adding to my web.xml

<jsp-config>
   <jsp-property-group>
      <display-name>whitespaces</display-name>
      <url-pattern>*.jsp</url-pattern>
      <trim-directive-whitespaces>true</trim-directive-whitespaces>
   </jsp-property-group>
</jsp-config>

and also tried adding the below to my jsp pages:
<%_at_page contentType="text/html" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>

but I still get whitespaces. for example if I have a

<select>
<c:forEach begin="1" end="31" varStatus="status">
   <option value="${status.index}">${status.index}</option>
</c:forEach>
</select>

it will print each <option> with a trailing new line, so the html will look like:

<option...

<option..

<option..

However, if the <c:forEach is written in a single line:

<c:forEach begin="1" end="31" varStatus="status"><option value="${status.index}">${status.index</option></c:forEach>

then it wont happen.

I thought the trimDirectiveWhitespaces directive avoided this.

I am on Glassfish3 Prelude - linux platform, developing with netbeans 6.7

Best.
-wm
[Message sent by forum member 'winterismute' (winterismute)]

http://forums.java.net/jive/thread.jspa?messageID=345978