users@glassfish.java.net

Re: trimDirectiveWhitespaces is not working as it should

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Tue, 12 May 2009 14:27:44 -0700

On 05/12/09 09:52 AM, glassfish_at_javadesktop.org wrote:
> 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.
>

trimDirectiveWhitespaces is only supposed to remove template text
consisting solely of blank lines or white space.

See example at http://java.sun.com/developer/technicalArticles/J2EE/jsp_21/


Jan

> -wm
> [Message sent by forum member 'winterismute' (winterismute)]
>
> http://forums.java.net/jive/thread.jspa?messageID=345978
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>