如何在 Wicket 中指定 HEAD 元素的 PROFILE 属性?
我正在使用 Wicket,我需要我的页面在其 head
元素中包含 profile
属性。由于 Wicket 负责渲染实际的 head
部分,因此不清楚如何执行此操作。我需要这样的 HTML:
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<link rel="search" type="application/opensearchdescription+xml" href="osdd.xml" title="Search"/>
</head>
对于感兴趣的读者,我正在尝试宣传我的 Web 应用程序的 OpenSearch 描述文档,如下所示: http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document
顺便说一句,当Web 框架让像这样的小任务变得如此困难!
I am using Wicket and I need my pages to include the profile
attribute with their head
element. Since Wicket takes care of rendering the actual head
section it is not apparent how to do this. I need HTML like so:
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<link rel="search" type="application/opensearchdescription+xml" href="osdd.xml" title="Search"/>
</head>
For the interested reader, I am trying to advertise my web application's OpenSearch Description Document as documented here: http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document
As an aside, I find it disgruntling and bad-smelling when a trivial task like this is made so difficult by the web framework!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用什么版本的 wicket?在 Wicket 1.4 中,您可以使用 Behavior 将任何属性添加到任何标记:
HTML:
java:
对于 Wicket 1.5,上述 SimpleAttributeModifier 的 Javadoc 会告诉您应该使用什么。
问候
PS:我认为这里没有什么困难。 Wicket 提供了几种添加标题部分的方法。我想向 中添加属性是一项相当不常见的任务。
What version of wicket are you using? In Wicket 1.4 you can add any attribute to any tag using an Behavior:
HTML:
java:
For Wicket 1.5, the Javadoc of the above SimpleAttributeModifier tells you what to use instead.
Regards
PS: I don 't see anything difficult here. Wicket provides a few ways to contribute to the header section. I guess adding an attribute to the is a rather uncomon task.