【问题标题】:understanding jsfc attribute了解 jsfc 属性
【发布时间】:2011-10-01 11:18:37
【问题描述】:

我需要有关 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。我将不胜感激。

【问题讨论】:

    标签: html css jsf-2 facelets


    【解决方案1】:

    我不确定在普通的输出组件中使用 jsfc 有什么用处。至少,HTML &lt;link rel="stylesheet"&gt; 在 JSF 中不是&lt;h:link&gt; 表示,而是由 &lt;h:outputStylesheet&gt; 表示。 &lt;h:link&gt; 呈现 HTML &lt;a&gt; 元素。从技术上讲,您应该改用jsfc="h:ouputStylesheet"。我只是摆脱了该属性,因为它在这里没有添加任何额外内容。

    猜你喜欢
    • 2011-01-21
    • 2015-07-27
    • 2014-03-30
    • 2019-09-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-17
    • 2015-04-14
    相关资源
    最近更新 更多