- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 jsf-impl.jar
(可以在 mvnrepository.com 上找到),*.taglib.xml
文件位于目录 com/sun/faces/metadata/taglib/
.
我不明白在这种情况下它们是如何被发现的,因为 JSF 2 specification 的第 10.3.2 章说:
10.3.2 Facelet Tag Library mechanism
...
The run time must support two modes of discovery for Facelet tag library descriptors
Via declaration in the web.xml, as specified in Section 11.1.3 “Application Configuration Parameters”
Via auto discovery by placing the tag library descriptor file within a jar on the web application classpath, naming the file so that it ends with
“.taglib.xml”
, without the quotes, and placing the file in theMETA-INF
directory in the jar file....
META-INF
中。 , 那么它是怎样工作的?
META-INF
,他们是一些
.tld
文件,但我对它们不感兴趣,因为我没有使用 JSP 作为 View ,而是使用 Facelets。
最佳答案
它没有使用 taglib.xml
为了那个原因。它通过 com.sun.faces.facelets.tag.jsf.html.HtmlLibrary
以编程方式注册它们在 com.sun.faces.application.ApplicationAssociate
它在启动期间执行。以下是 Mojarra 2.2.1 中的相关行(从 Grepcode 复制粘贴):
954 c.addTagLibrary(new CoreLibrary());
955 c.addTagLibrary(new CoreLibrary(CoreLibrary.XMLNSNamespace));
956 c.addTagLibrary(new HtmlLibrary());
957 c.addTagLibrary(new HtmlLibrary(HtmlLibrary.XMLNSNamespace));
958 c.addTagLibrary(new UILibrary());
959 c.addTagLibrary(new UILibrary(UILibrary.XMLNSNamespace));
960 c.addTagLibrary(new JstlCoreLibrary());
961 c.addTagLibrary(new JstlCoreLibrary(JstlCoreLibrary.IncorrectNamespace));
962 c.addTagLibrary(new JstlCoreLibrary(JstlCoreLibrary.XMLNSNamespace));
963 c.addTagLibrary(new PassThroughAttributeLibrary());
964 c.addTagLibrary(new PassThroughElementLibrary());
965 c.addTagLibrary(new FunctionLibrary(JstlFunction.class, FunctionLibrary.Namespace));
966 c.addTagLibrary(new FunctionLibrary(JstlFunction.class, FunctionLibrary.XMLNSNamespace));
967 if (isDevModeEnabled()) {
968 c.addTagLibrary(new FunctionLibrary(DevTools.class, DevTools.Namespace));
969 c.addTagLibrary(new FunctionLibrary(DevTools.class, DevTools.NewNamespace));
970 }
971 c.addTagLibrary(new CompositeLibrary());
972 c.addTagLibrary(new CompositeLibrary(CompositeLibrary.XMLNSNamespace));
关于jsf-2 - 在 jsf-impl.jar 中发现了 JSF2 : How are the *. taglib.xml 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19027595/
我是一名优秀的程序员,十分优秀!