简体   繁体   English

复合组件的资源解析器

[英]Resource Resolver for Composite Components

Could someone please explain what is responsible in MyFaces to figure out what is to treated as a resource/composite component. 有人可以解释一下MyFaces中负责什么的工作,以弄清楚什么被视为资源/复合组件。 I am seeing this strange behavior where html tags like div,li etc are trying to be resolved as composite components. 我看到这种奇怪的行为,其中html标签(例如div,li等)正试图解析为复合组件。 I am seeing the Classloader looking for {mycompositecomponentnamespace}/div.xhtml, {mycompositecomponentnamespace}/li.xhtml etc 我看到Classloader正在寻找{mycompositecomponentnamespace} /div.xhtml,{mycompositecomponentnamespace} /li.xhtml等

In essence, my question is, how does myfaces know which tag needs to be treated as a resource lookup for a composite component, and which is to be ignored as a standard html tag 本质上,我的问题是,myfaces如何知道哪个标签需要被视为复合组件的资源查找,而哪个标签将被视为标准html标签而被忽略

In few words, the algorithm just do what JSF spec says. 简而言之,该算法完全可以满足JSF规范的要求。 If the associated namespace to a library has an composite component resource library, facelets algorithm scan for composite components following JSF 2.0 Resource Handler algorithm. 如果与库关联的名称空间具有复合组件资源库,则facelets算法将按照JSF 2.0 Resource Handler算法扫描复合组件。 In JSF 2.2, things were changed to include resource library contracts too. 在JSF 2.2中,情况也进行了更改,以包括资源库合同。 How MyFaces do it in code is part of its own implementation, but it follows the algorithm proposed on the spec. MyFaces如何在代码中执行此操作是其自身实现的一部分,但它遵循规范中提出的算法。

MyFaces2.0.2 and 2.0.3 when trying to parse a Facelet using a SAXParser does try to look up each tag as a resource in the Classloader. 尝试使用SAXParser解析Facelet时,MyFaces2.0.2和2.0.3确实尝试将每个标签作为类加载器中的资源进行查找。 I would have thought it would have the smarts to realize what needs to be looked up and what is a standard HTML tag. 我本以为拥有要查找的内容以及什么是标准HTML标签的聪明才智。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM