需要一个基于Java的HTML美化工来清理Velocity生成的HTML [英] Need a Java-based HTML prettifier to clean up Velocity-generated HTML

查看:126
本文介绍了需要一个基于Java的HTML美化工来清理Velocity生成的HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用的Web应用程序使用Velocity模板生成HTML。问题是,在速度模板和其他格式中使用空格会导致对接丑陋的HTML(过多空白,未对齐等)。

寻找一个不错的很好)基于Java的HTML美化工具可以在将其转储到servlet响应之前运行生成的HTML,以使源代码更好看。



第三方集成商希望能够浏览HTML并知道哪些模板导致问题。第一步是HTML格式。



感谢您提供的任何指导!

解决方案

JTidy 有一个 JTidyFilter 。只需在 web.xml 中定义它,HTML就会被批准。


Web app I'm working on generates HTML using Velocity templates. Problem is that using whitespace in velocity templates and other formatting results in butt-ugly HTML (excessive whitespace, misalignment, etc.)

Looking for a nice (single jar packaging would be nice) Java-based HTML prettifier to run over the generated HTML right before we dump it to the servlet response to make the source nicer to look at.

Third party integrators would like to be able to glance at the HTML and know which templates are causing problems. The first step to this is having the HTML formatted nicely.

Thanks in advance for any guidance you can provide!

解决方案

JTidy has a JTidyFilter. Just define it in web.xml and the respone HTML will be prettified.

这篇关于需要一个基于Java的HTML美化工来清理Velocity生成的HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆