You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by "Luchs, Marvin" <Ma...@t-systems.com> on 2012/07/03 11:59:05 UTC
White Space and Line Breaks removed from HTML source
Hi,
I am using Apache Tiles 2.2.2 (with Spring) and I am wondering if nobody
except me had the following problem as I can't find any information
about it.
In my .jspx file I have the following markup:
<div class="actions">
<button><i class="icon-ok"></i> Button 1</button>
<button><i class="icon-remove "></i> Button 2</button>
</div>
When rendered using Apache Tiles it becomes this:
<div class="actions"><button><i class="icon-ok" />Button
1</button><button><i class="icon-remove" />Button 2</button></div>
As you can see, there are several modifications to the markup I've
written.
- line breaks and indentation are missing
- the <i> elements have been re-written to self-closing elements
- the space between <i> and the button's text has been removed
Those modifications have some pretty annoying consequences:
1. I have no problem with the removal of the indentation spaces but the
missing line breaks cause the buttons to sit directly next to each
other. With the old markup there was a space between both buttons.
2. The self-closing <i> elements do not work in Firefox and Opera as per
HTML specification those tags aren't allowed to be self-closing
(However, there's a workaround (or hack as I would call it) by inserting
<jsp:text />).
3. The missing space between <i> and the element's text should be an
obvious problem. When I want a space at this position, it shouldn't be
stripped.
Of course I could solve all these problems using workarounds like adding
margin via CSS or - but isn't there another solution? Something
more professional?
Thanks in advance for any advice
Best regards,
Marvin
AW: White Space and Line Breaks removed from HTML source
Posted by "Luchs, Marvin" <Ma...@t-systems.com>.
Well that would explain why I couldn't find any information about this issue :-) Thank you!
-----Ursprüngliche Nachricht-----
Von: Nicolas LE BAS [mailto:mail@nlebas.net]
Gesendet: Dienstag, 3. Juli 2012 13:21
An: users@tiles.apache.org
Betreff: Re: White Space and Line Breaks removed from HTML source
On 12-07-03 05:59 AM, Luchs, Marvin wrote:
> Hi,
>
> I am using Apache Tiles 2.2.2 (with Spring) and I am wondering if nobody > except me had the following problem as I can't find any information > about it.
>
> In my .jspx file I have the following markup:
>
> <div class="actions">
> <button><i class="icon-ok"></i> Button 1</button>
> <button><i class="icon-remove "></i> Button 2</button>
> </div>
>
> When rendered using Apache Tiles it becomes this:
>
> <div class="actions"><button><i class="icon-ok" />Button > 1</button><button><i class="icon-remove" />Button 2</button></div> > > As you can see, there are several modifications to the markup I've > written.
Hi Marvin,
Apache Tiles is definitely *not* rewriting anything, whatever the version.
I believe your JSP container is the culprit, optimizing the XML tags, either because it's a .jspx instead of .jsp, or perhaps because you use the tag <jsp:root>, or because of some configuration.
I'll refer you to the documentation of your application server.
Hope this helps,
Nick
Re: White Space and Line Breaks removed from HTML source
Posted by Nicolas LE BAS <ma...@nlebas.net>.
On 12-07-03 05:59 AM, Luchs, Marvin wrote:
> Hi,
>
> I am using Apache Tiles 2.2.2 (with Spring) and I am wondering if nobody
> except me had the following problem as I can't find any information
> about it.
>
> In my .jspx file I have the following markup:
>
> <div class="actions">
> <button><i class="icon-ok"></i> Button 1</button>
> <button><i class="icon-remove "></i> Button 2</button>
> </div>
>
> When rendered using Apache Tiles it becomes this:
>
> <div class="actions"><button><i class="icon-ok" />Button
> 1</button><button><i class="icon-remove" />Button 2</button></div>
>
> As you can see, there are several modifications to the markup I've
> written.
Hi Marvin,
Apache Tiles is definitely *not* rewriting anything, whatever the version.
I believe your JSP container is the culprit, optimizing the XML tags,
either because it's a .jspx instead of .jsp, or perhaps because you use
the tag <jsp:root>, or because of some configuration.
I'll refer you to the documentation of your application server.
Hope this helps,
Nick