3 Replies Latest reply on Mar 5, 2009 8:00 PM by apemberton

    trim whitespace at jsp

      Hi guys,

      I was wondering how to trim whitespaces on my portlets which I deployed at jboss Portal 2.7. Is there any possibilty which is included at the portal?

      Any help will be appreciated :)

      Regards

        • 1. Re: trim whitespace at jsp

          JBoss Portal 2.7 uses JBoss AS 4.2.3, which in turn uses Tomcat 5.5 under the covers as the servlet engine.

          Tomcat 5.5 is Servlet 2.4/JSP 2.0 compatible, so you can't use the JSP 2.1 trimDirectiveWhiteSpaces feature.

          You can, however, use the trimSpaces init-param per http://raibledesigns.com/rd/entry/trim_spaces_in_your_jsp

          One warning: you may run into issues where white space is trimmed a bit further than you may be expecting. For example, two <c:out /> tags in a row may not have a space between them.

          As for bang for your buck, I'd recommend looking into GZipping your portal page requests - which may save more bandwidth than trimspaces in your environment.

          I plan on writing a blog article in the next weeks discussing some of these Portal-tier performance tuning tips.

          Good luck!

          • 2. Re: trim whitespace at jsp

            Hi Andy,

            thanks for your reply, maybe you got some links bout GZipping on request. To be honest never heard of it and some links which provide the first steps would be nice.

            Regards :)

            • 3. Re: trim whitespace at jsp

              Well, this would depend on your installation scenario a bit.

              For example, if you front your portal server with Apache web server, you can use mod_deflate to GZip your response: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html.

              If you're hitting the portal server directly, you could configure a servlet filter to GZip your responses; I wrote an article recently on using pack:tag w/Portal which can be configured to compress the Portal page response: http://www.andypemberton.com/jboss/compress-your-jboss-portal-theme-with-packtag/.