且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在JSF模板中处理特定的名称空间声明

更新时间:2023-10-05 16:55:16

这意味着没有PrimeFaces组件的页面仍将具有PrimeFaces命名空间声明.这是个好主意吗?

这完全没有害处. Facelets会在呈现HTML时将它们修剪掉.如果未在当前模板中的任何地方使用命名空间声明,则可以将其保留.请注意,名称空间声明仅适用于当前模板,不适用于包含/装饰的模板.

This doesn't harm at all. Facelets will trim them out anyway while rendering HTML. You can leave the namespace declarations away if it's not been used anywhere in the current template. Note that the namespace declarations only applies to the current template, not to the included/decorated templates.

我们如何将非通用名称空间从主模板中排除并在特定页面中声明?

您可以这样做.那应该不成问题.

You can just do so. That should not form a problem.