Is there any JBoss 5.1 plugin or utility that automatically removed all the leading and trailing white spaces in an HTML it is sending as a response. Or something similar can be done to JSP when they are deployed. Even an application specific setting would do.
I am already using
<init-param>
<param-name>trimSpaces</param-name>
<param-value>true</param-value>
</init-param>
but this is not working for me.
I have read other articles which says to reduce the file before deploying it, but I was wondering if there is any automated solut开发者_运维知识库ion to this, instead of cleaning each file manually.
You can write a ServletFilter to do this.
For example code doing pretty much what you're after, look at this whitespace filter on BalusC's blog.
精彩评论