开发者

JBoss 5.1 removing whitespaces in response html

开发者 https://www.devze.com 2023-02-08 19:04 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号