JBoss 5.1 删除响应 html 中的空格
是否有任何 JBoss 5.1 插件或实用程序可以自动删除作为响应发送的 HTML 中的所有前导和尾随空格。或者在部署 JSP 时可以对它们进行类似的操作。 即使是特定于应用程序的设置也可以。
我已经在使用了,
<init-param>
<param-name>trimSpaces</param-name>
<param-value>true</param-value>
</init-param>
但这对我不起作用。
我读过其他文章,其中提到在部署之前减少文件,但我想知道是否有任何自动化解决方案,而不是手动清理每个文件。
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 solution to this, instead of cleaning each file manually.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以编写 ServletFilter 来执行此操作。
例如,代码几乎可以完成您想要的操作,请查看此 空白过滤器在 BalusC 的博客上。
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.