开发者

JBoss 5.1 removing whitespaces in response html

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜