[JSTL] Generated HTML too large (whitespace)

Discussion in 'Java' started by Karsten Wutzke, Nov 4, 2003.

  1. Hi all!

    When generating HTML code from the template JSP/JSTL files, I keep my
    code well indented. However, this makes *a lot* of whitespace, so that
    simple pages end up being 189KB and so on. This is really bad for
    everything.

    Is there any kind of server setting that removes all whitespace before
    seding back the code? Or maybe some other way?

    I just hope I don't have to make one lined JSP files just to achieve that...

    Karsten

    PS: Sorry, this might be a little OT.
     
    Karsten Wutzke, Nov 4, 2003
    #1
    1. Advertising

  2. Karsten Wutzke

    Ben_ Guest

    This can be done in several ways:
    .. at the web container level:
    . implement a servlet filter to trim the spaces after your servlet/jsp
    is called (maybe such filter already exists)
    .. at the http server level:
    . an Apache mod could do it (don't know for sure, but chances are that
    an mod already exists for this)
    . gzip the traffic (Apache has plug-ins for that), but drawback: when
    you sniff traffic, all you see is zipped...
     
    Ben_, Nov 4, 2003
    #2
    1. Advertising

  3. Karsten Wutzke

    Roedy Green Guest

    On Tue, 04 Nov 2003 18:19:56 +0100, Karsten Wutzke
    <> wrote or quoted :

    >Is there any kind of server setting that removes all whitespace before
    >seding back the code? Or maybe some other way?


    I have a class called Compactor that removes non-significant
    whitespace.

    I use it in the Replicator to prepare files for export. I also use it
    on my website. I have not got around to distributing it yet as a
    separate product. Ditto with untouch, the program that redates files
    back to their original if they have not really changed, which is also
    part of the Replicator. I also have an HTML macro scheme that lets
    you write macros in Java for expansion.


    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Nov 4, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Mark Bram

    Custom JSTL that accepts JSTL expression

    Robert Mark Bram, Dec 15, 2004, in forum: Java
    Replies:
    0
    Views:
    982
    Robert Mark Bram
    Dec 15, 2004
  2. Luigi Donatello Asero

    Are these pictures too dark or/and too large?

    Luigi Donatello Asero, May 19, 2004, in forum: HTML
    Replies:
    13
    Views:
    928
    Mabden
    May 21, 2004
  3. Luigi Donatello Asero

    Re: Are these pictures too dark or/and too large?

    Luigi Donatello Asero, May 21, 2004, in forum: HTML
    Replies:
    0
    Views:
    658
    Luigi Donatello Asero
    May 21, 2004
  4. DaFoot
    Replies:
    1
    Views:
    1,717
    DaFoot
    Oct 23, 2008
  5. Gregory Toomey

    Whitespace removal in html generated by cgi

    Gregory Toomey, Nov 16, 2003, in forum: Perl Misc
    Replies:
    11
    Views:
    300
    Louis Erickson
    Nov 17, 2003
Loading...

Share This Page