了解 jsfc 属性
我需要有关 Facelets 的帮助,特别是 HTML 标记中的 jsfc
属性。我很难理解以下内容是否有效。
<head jsfc="h:head">
<ui:insert name="head"/>
<base href="http://localhost:8080/Jerel-Baker/"/>
<link jsfc="h:link" rel='stylesheet' type='text/css' href='styles/style.css'/>
<link jsfc="h:link" rel='stylesheet' media='screen and (max-width: 700px)' href='styles/narrow.css'
type="text/css"/>
<link rel='stylesheet' media='screen and (min-width: 701px) and (max-width: 900px)'
href='styles/medium.css' type="text/css"/>
<link rel='stylesheet' media='screen and (min-width: 901px)' href="styles/wide.css" type="text/css"/>
<title>#{msg.title}</title>
</head>
当我在每个链接元素中放置 jsfc="h:link"
时,CSS 不会呈现。我将非常感谢任何帮助。
I need help with regard to Facelets and specifically the jsfc
attribute in HTML tags. I am having difficulty getting understanding if the following will work.
<head jsfc="h:head">
<ui:insert name="head"/>
<base href="http://localhost:8080/Jerel-Baker/"/>
<link jsfc="h:link" rel='stylesheet' type='text/css' href='styles/style.css'/>
<link jsfc="h:link" rel='stylesheet' media='screen and (max-width: 700px)' href='styles/narrow.css'
type="text/css"/>
<link rel='stylesheet' media='screen and (min-width: 701px) and (max-width: 900px)'
href='styles/medium.css' type="text/css"/>
<link rel='stylesheet' media='screen and (min-width: 901px)' href="styles/wide.css" type="text/css"/>
<title>#{msg.title}</title>
</head>
When I put a jsfc="h:link"
in each of my link elements, the css is not rendered. I would greatly appreciate any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定在普通输出组件中使用 jsfc 有何用处。至少,HTML
在 JSF 中不是由
表示,但通过
。
呈现 HTML元素。从技术上讲,您应该改用 jsfc="h:ouputStylesheet"。我只是删除该属性,因为它在这里没有添加任何额外的内容。
I'm not sure how it's useful to use
jsfc
in a plain vanilla output component. At least, the HTML<link rel="stylesheet">
is in JSF not represented by a<h:link>
, but by<h:outputStylesheet>
. The<h:link>
renders a HTML<a>
element. Technically, you should be usingjsfc="h:ouputStylesheet"
instead. I'd just get rid of the attribute since it adds nothing extra here.