MyFaces 永远不会为未定义的自定义标签引发异常
我正在尝试编写一些自定义 Facelets 2.0 标记,经过几个小时的工作,我发现我的 UIInput 子类甚至没有实例化。然后,我将实际的命名空间更改为:
<html xmlns:my="http://bad-namespace">
...
<my:foo />
</html>
您看,现在 my
指向一个不存在的命名空间 http://bad-namespace
,这应该会引发一些错误,但是,没有引发异常,
只是默默地跳过了!
因此,我无法使我的标签工作,也看不到任何错误。我只是不知道该怎么办。不过,我是开发自定义 Facelets 2.0 标签的新手。我在 google 上搜索了有关 Facelets 2.0 自定义标签的教程,但没有获得太多信息,大部分都集中在旧的 JSF 1.2 上。
I'm trying to write some custom Facelets 2.0 tags, after several hours work, I found that my UIInput subclass is not even instantiated. Then, I changed the actual namespace to something like:
<html xmlns:my="http://bad-namespace">
...
<my:foo />
</html>
You see, now my
points to an non-existing namespace http://bad-namespace
which should raise something error, however, no exception raised, <my:foo />
is just silently skipped!
So, I can't make my tag work, and I can't see any error, too. I have just no idea what to do. I'm new to develop custom Facelets 2.0 tags, though. I have googled tutorials on Facelets 2.0 custom tags, but didn't get much information, mostly are focused on the old JSF 1.2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我检查了一下,MyFaces 没有显示任何内容。这似乎是添加到 MyFaces 上的一个很好的功能。理论上,放置命名空间并将其传递给生成的文档是有效的,因此这不是一个错误,但实际上,对开发时间的警告并没有什么害处。我为你创建了这个问题 MYFACES-3215,来处理它,所以留下来使用 MyFaces 用户和开发人员列表进行调整,因为这将在未来版本中添加。
I checked and MyFaces does not show anything. This seems to be a good feature to add on MyFaces. In theory it is valid to put namespaces and pass it to the generated document, so it is not a bug, but in practice a warning on dev time does not harm. I created this issue for you MYFACES-3215, to deal with it, so stay tuned with MyFaces Users and Dev Lists because this will be added in future releases.