Compress tag

Lukasz Lenart <[email protected]> Sun, 18 May 2025 08:35:29 +0200
Newsgroups gmane.comp.jakarta.struts.devel
Message-ID <CAMopvkOrvyn4Wd7DBM_hHCSK-K7E4+0szV9RazaOR3m3WTeA9Q@mail.gmail.com>
Hi

I'm working on implementing <s:compress/> tag which can be used to
improve generated HTML by stripping out empty spaces and line breaks.
https://github.com/apache/struts/pull/1272

It has some limitation especially around empty spaces and line breaks
inside the tag, eg:

<td
   class="tdInput">...

In such cases compression won't be applied as this is basically a
broken template and should be fixed separately.

First, I wanted to use the <@compress> Freemarker directive but this
can be a huge change impacting users, so I decided to let users to
make a choice which parts of their pages need to be optimized
https://freemarker.apache.org/docs/dgui_misc_whitespace.html#autoid_30

Yet, I want to implement a new HTML5 theme which will use strict compression.


Cheers
Ɓukasz