是否有理由使用 html 作为 Facelets 根而不是 ui:composition?
我注意到用于创建 Facelets 模板客户端页面的 Netbeans 向导提供了将 html 或 ui:composition 作为页面文档根的选项。
为了保持时间的一致性,我总是使用 html 选项,然后继续使用它以保持一致性。但我意识到,如果我使用ui:composition,那么我将为文档正文保存两级缩进。
我记得使用 html 的唯一原因是我在某处读到这种格式假设在某个 IDE 中很有用。不过我还没有遇到过。
是否有任何理由继续使用 html 作为文档根?
I notice the Netbeans wizard to create a Facelets template client page gives the option to have either html or ui:composition as the document root for the page.
For time out of mind I have always used the html option, then kept using it for consistency. Yet I realized that if I used ui:composition then I would save two levels of indentation for the body of my document.
The only reason to keep with html that I can remember is that I read somewhere that this format was hypothetically useful in an IDE somewhere. However I have never encountered it.
Is there any reason to keep using html as the document root?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Facelets 应该是“设计师友好的”。能够在 Facelets 标记周围添加额外的标记,以及诸如
jsfc
属性或ui:remove
之类的功能,其目的是让您编写能够正确呈现的 JSF 页面在 Web 浏览器中预览时无需在容器中实际运行应用程序。 (例如:为了更轻松地调整单个视图的 CSS。)如果您不需要这样做,您可以安全地保留多余的混乱。
Facelets is supposed to be "designer friendly". The point of being able to have extra tags around the Facelets markup, and of features like the
jsfc
attribute orui:remove
is to let you write JSF pages that will render correctly when previewed in a web browser without having to actually run the application in a container. (E.g.: To make it easier to just tweak CSS for a single view.)If you have no need for this, you can safely leave the extra clutter out.