久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='azM4v'><tr id='azM4v'><dt id='azM4v'><q id='azM4v'><span id='azM4v'><b id='azM4v'><form id='azM4v'><ins id='azM4v'></ins><ul id='azM4v'></ul><sub id='azM4v'></sub></form><legend id='azM4v'></legend><bdo id='azM4v'><pre id='azM4v'><center id='azM4v'></center></pre></bdo></b><th id='azM4v'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='azM4v'><tfoot id='azM4v'></tfoot><dl id='azM4v'><fieldset id='azM4v'></fieldset></dl></div>

    • <bdo id='azM4v'></bdo><ul id='azM4v'></ul>

      <legend id='azM4v'><style id='azM4v'><dir id='azM4v'><q id='azM4v'></q></dir></style></legend>
    1. <small id='azM4v'></small><noframes id='azM4v'>

      1. <tfoot id='azM4v'></tfoot>

      2. 在純 HTML 屬性中使用 JSF EL

        Using JSF EL in a plain HTML attribute(在純 HTML 屬性中使用 JSF EL)

          <tbody id='5QZMn'></tbody>
          <legend id='5QZMn'><style id='5QZMn'><dir id='5QZMn'><q id='5QZMn'></q></dir></style></legend>
        • <small id='5QZMn'></small><noframes id='5QZMn'>

              <tfoot id='5QZMn'></tfoot>

                <i id='5QZMn'><tr id='5QZMn'><dt id='5QZMn'><q id='5QZMn'><span id='5QZMn'><b id='5QZMn'><form id='5QZMn'><ins id='5QZMn'></ins><ul id='5QZMn'></ul><sub id='5QZMn'></sub></form><legend id='5QZMn'></legend><bdo id='5QZMn'><pre id='5QZMn'><center id='5QZMn'></center></pre></bdo></b><th id='5QZMn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5QZMn'><tfoot id='5QZMn'></tfoot><dl id='5QZMn'><fieldset id='5QZMn'></fieldset></dl></div>
                  <bdo id='5QZMn'></bdo><ul id='5QZMn'></ul>

                  本文介紹了在純 HTML 屬性中使用 JSF EL的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我們可以在 HTML 標(biāo)簽中使用 JSF EL 嗎?例如,在純 HTML <td> 元素中,我們可以將 EL #{bean.color} 用于 bgcolor 屬性嗎?

                  Can we use JSF EL inside a HTML tag? For example, inside a plain HTML <td> element, can we use EL #{bean.color} for the bgcolor attribute?

                  <td bgcolor="#{bean.color}">
                  

                  推薦答案

                  答案取決于 JSF 版本和使用的視圖技術(shù).您正在尋找的技術(shù)術(shù)語是在模板文本中使用 EL"(即不在任何標(biāo)簽/組件內(nèi)).

                  The answer depends on the JSF version and the view technology used. The technical term you're looking for is "using EL in template text" (i.e. not inside any tag/component).

                  根據(jù)您的問題歷史記錄,您在 Websphere 上使用 JSF 1.2.我假設(shè)您仍在使用舊的 JSP,它是 Facelets 的前身.JSF EL #{} 是否適用于模板文本取決于所使用的 JSP 版本.JSP 版本與 Servlet 版本齊頭并進(jìn).

                  As per your question history you're using JSF 1.2 on Websphere. I assume that you're still using old JSP, the predecesor of Facelets. Whether JSF EL #{} works in template text depends on the JSP version used. JSP version goes hand in hand with Servlet version.

                  當(dāng)您的容器支持 Servlet 2.5 并且 web.xml 被聲明為符合 Servlet 2.5 時(shí),那么您使用的是 JSP 2.1.在這種情況下,您可以在 JSP 中使用 #{bean}.JSF EL #{} 即以統(tǒng)一 EL"的名稱從 JSF 1.1 移至 JSP 2.1.

                  When your container supports Servlet 2.5 and the web.xml is declared conform Servlet 2.5, then you're using JSP 2.1. In that case, you can just use #{bean} in JSP. The JSF EL #{} was namely moved from JSF 1.1 to JSP 2.1 under the name "unified EL".

                  <td bgcolor="#{bean.color}">
                  

                  但是,當(dāng)您的容器最多支持 Servlet 2.4 時(shí),您基本上使用的是 JSP 2.0,您必須改用 ${bean}.

                  However, when your container supports at most Servlet 2.4, then you're basically using JSP 2.0 and you have to use ${bean} instead.

                  <td bgcolor="${bean.color}">
                  

                  這只有一個(gè)前提條件:在同一個(gè)文檔中,上面的某處通過 ${bean} 引用 JSF bean 的行,你需要確保您已經(jīng)已經(jīng)在 JSF 標(biāo)記中事先通過 #{bean} 引用了同一個(gè) bean,否則不會(huì)預(yù)先創(chuàng)建 bean.

                  This has only one prerequirement: in the same document, somewhere before the above line where you reference the JSF bean by ${bean}, you need to ensure that you've already referenced the very same bean by #{bean} in a JSF tag beforehand, otherwise the bean won't be precreated.

                  當(dāng)您使用 JSP 的繼任者 Facelets 時(shí),甚至雖然在 Servlet 2.4 環(huán)境中,但您可以使用

                  When you're using the JSP's successor Facelets, even though in a Servlet 2.4 environment, then you can just use

                  <td bgcolor="#{bean.color}">
                  

                  另見:

                  • JSP EL、JSF EL 和 Unified EL 的區(qū)別 - 一點(diǎn) EL 的歷史
                  • 是否建議對(duì)所有內(nèi)容都使用 h:outputText?
                  • PWC6228: #{...} 不允許在模板正文
                  • See also:

                    • Difference between JSP EL, JSF EL and Unified EL - A bit of history of EL
                    • Is it suggested to use h:outputText for everything?
                    • PWC6228: #{...} not allowed in a template text body
                    • 與問題無關(guān)bgcolor 屬性在 HTML 中已棄用.您應(yīng)該改用 CSS style 屬性.

                      Unrelated to the problem, the bgcolor attribute is deprecated in HTML. You should be using CSS style attribute instead.

                      <td style="background: #{bean.color}">
                      

                      即便如此,上述做法仍被認(rèn)為是糟糕的做法.將 CSS 放入您通過 <link>/<h:outputStylesheet> 包含的 .css 樣式表文件中,并使用合理的類名(例如.odd、.even.success.cancelled 等)并改為渲染 CSS 樣式類.例如,如果顏色取決于某些狀態(tài):

                      Even then, the above is considered poor practice. Put CSS in a .css stylesheet file which you include via <link>/<h:outputStylesheet> and use sensible classnames (e.g. .odd, .even, .success, .cancelled, etc) and render a CSS style class instead. For example, if the color depends on some status:

                      <td class="#{bean.status}">
                      

                      這篇關(guān)于在純 HTML 屬性中使用 JSF EL的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                      【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  Input validation with pattern Angular 2(使用模式 Angular 2 進(jìn)行輸入驗(yàn)證)
                  How to change the css class name dynamically in angular 2(如何在角度2中動(dòng)態(tài)更改css類名)
                  How to remove default color in input type?(如何刪除輸入類型中的默認(rèn)顏色?)
                  How to add click event to dynamically added html element in typescript(如何將點(diǎn)擊事件添加到打字稿中動(dòng)態(tài)添加的html元素)
                  XPath one of multiple attribute values with condition(XPath 具有條件的多個(gè)屬性值之一)
                  <i id='7HehP'><tr id='7HehP'><dt id='7HehP'><q id='7HehP'><span id='7HehP'><b id='7HehP'><form id='7HehP'><ins id='7HehP'></ins><ul id='7HehP'></ul><sub id='7HehP'></sub></form><legend id='7HehP'></legend><bdo id='7HehP'><pre id='7HehP'><center id='7HehP'></center></pre></bdo></b><th id='7HehP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7HehP'><tfoot id='7HehP'></tfoot><dl id='7HehP'><fieldset id='7HehP'></fieldset></dl></div>
                    <tbody id='7HehP'></tbody>
                      <legend id='7HehP'><style id='7HehP'><dir id='7HehP'><q id='7HehP'></q></dir></style></legend>
                    1. <small id='7HehP'></small><noframes id='7HehP'>

                      • <bdo id='7HehP'></bdo><ul id='7HehP'></ul>

                        <tfoot id='7HehP'></tfoot>

                            主站蜘蛛池模板: 久久这里有精品 | 日韩一区二区三区视频 | 亚洲小视频在线观看 | 一区二区三区四区在线免费观看 | 亚洲精品视频导航 | 欧美一级二级视频 | 特级一级黄色片 | 伊人99 | 色就干 | 久久精品视频一区二区三区 | 国产日韩一区二区三区 | 精品一区二区三区在线播放 | 国产精品成人久久久久 | 亚洲成人免费视频在线观看 | 日韩精品网站 | 国产精品日本一区二区在线播放 | 久久91av| 亚洲一区在线日韩在线深爱 | 久久男人 | 狠狠狠色丁香婷婷综合久久五月 | 人人干超碰 | 久久视频精品 | 免费一级淫片aaa片毛片a级 | 久久欧美精品 | 亚洲午夜精品 | 91久久久久久久久久久久久 | 在线播放一区 | 国产亚洲精品综合一区 | 成人福利在线视频 | 91中文在线观看 | 国产成人精品一区二区三区 | 福利社午夜影院 | 日韩1区 | 亚洲综合久久久 | 国产乱xxav | 99色综合| 成年人在线观看 | 伊人二区 | 国产精品毛片无码 | 欧美日韩18 | 亚洲 一区 |