Discussions

Web tier: servlets, JSP, Web frameworks: removing extra white spaces in compiled JSPs

  1. removing extra white spaces in compiled JSPs (6 messages)

    In my application, I am using websphere compiler to compile the JSPs. There are lots of white spaces that are generated in the servlet that is generated for that JSP...having this white space in the compiled JSP is raised as a flag by the network group. Some of the compiled JSPs have more than 100 KB of white space...which is causing unnecessary network traffic.

    Is there any tool of any option while compiling the JSPs to remove the white spaces from the JSPs completely??

    Thanks,

    Threaded Messages (6)

  2. See for example Trim filter in JSOS:
    http://www.servletsuite.com/servlets/trimflt.htm
  3. Remove white space[ Go to top ]

    I did put the entries in teh web XML...but my websphere JSP compiler is not recognizing the <filter> node....it is giving me errors...

    do I have to use a different JSP compiler?
  4. removing white spaces from JSPs[ Go to top ]

    I was able to compile the JSPs with the filter jar file and making the web.xml entries....
    But when finally the JSp is invoked from the application...and I clicked view source....I can the spaces in the JSP as is...!!

    anything that I need to do specifically?
  5. removing extra white spaces in compiled JSPs[ Go to top ]

    In Tomcat 5.5+ you can get rid of whitespaces in your webapp by adding this param to web.xml:

    <init-param>
      <param-name>trimSpaces</param-name>
      <param-value>true</param-value>
    </init-param>

    Don't know if it works in Websphere too.
  6. In Tomcat 5.5+ you can get rid of whitespaces in your webapp by adding this param to web.xml:<init-param>&nbsp;&nbsp;<param-name>trimSpaces</param-name>&nbsp;&nbsp;<param-value>true</param-value></init-param>Don't know if it works in Websphere too.

    If you put it in $CATALINA_HOME/conf/web.xml you get rid of whitespaces for all JSPs of all webapps.
  7. Removing white spaces from jsp[ Go to top ]

    WORKED FINE..!!! Since I am using struts all my requests are *.do..when we put *.do in web.xml the filter worked fine.. Thanks