<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 0,  comments - 0,  trackbacks - 0

    Table 2-4. Predefined Objects in the Value Expression Language
    Variable Name Meaning
    header A Map of HTTP header parameters, containing only the first value for each name.
    headerValues A Map of HTTP header parameters, yielding a String[]array of all values for a given name.
    param A Map of HTTP request parameters, containing only the first value for each name.
    paramValues A Map of HTTP request parameters, yielding a String[]array of all values for a given name.
    cookie A Map of the cookie names and values of the current request.
    initParam A Map of the initialization parameters of this web application. Initialization parameters are discussed in Chapter 10.
    requestScope A Map of all request scope attributes.
    sessionScope A Map of all session scope attributes.
    applicationScope A Map of all application scope attributes.
    facesContext The FacesContext instance of this request. This class is discussed in Chapter 6.
    view The UIViewRoot instance of this request. This class is discussed in

     Finally, if the name is still not found, it is passed to the VariableResolver of the JSF application. The default variable resolver looks up managed-bean elements in a configuration resource, typically the faces-config.xml file.

    Consider, for example, the expression

      #{user.password}


    The term user is not one of the predefined(預定義) objects. When it is encountered(遇到) for the first time, it is not an attribute name in request, session, or application scope.

    Therefore, the variable resolver processes the faces-config.xml entry:

      <managed-bean>
         <managed-bean-name>user</managed-bean-name>
         <managed-bean-class>com.corejsf.UserBean</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>


    The variable resolver calls the default constructor of the class com.corejsf.User-Bean. Next, it adds an association to the sessionScope map. Finally, it returns the object as the result of the lookup.

    When the term user needs to be resolved again in the same session, it is located in the session scope


    Composite Expressions
        

    You can use a limited set of operators inside value expressions:

    Arithmetic operators + - * / %. The last two operators have alphabetic variants div and mod.

    Relational operators < <= > >= == != and their alphabetic variants lt le gt ge eq ne. The first four variants are required for XML safety.

    Logical operators && || ! and their alphabetic variants and or not. The first variant is required for XML safety.

    The empty operator. The expression empty a is true if a is null, an array or String of length 0, or a Collection or Map of size 0.

    The ternary ?: selection operator.

     Operator precedence follows the same rules as in Java. The empty operator has the same precedence as the unary - and ! operators.

     Generally, you do not want to do a lot of expression computation in web pages—that would violate the separation of presentation and business logic. However, occasionally, the presentation layer can benefit from operators. For example, suppose you want to hide a component when the hide property of a bean is true. To hide a component, you set its rendered attribute to false. Inverting the bean value requires the ! (or not) operator:

      <h:inputText rendered="#{!bean.hide}" ... />


     

    Finally, you can concatenate plain strings and value expressions by placing them next to each other. Consider, for example,

      <h:outputText value="#{messages.greeting}, #{user.name}!"/>


     

    The statement concatenates four strings: the string returned from #{messages. greeting}, the string consisting of a comma and a space, the string returned from #{user.name}, and the string consisting of an exclamation mark.


            
    上文出自:《core JavaServer™ Faces, Second Edition》

    posted on 2007-12-11 19:25 *一凡* 閱讀(146) 評論(0)  編輯  收藏 所屬分類: JSF
    主站蜘蛛池模板: 免费在线看v网址| 国产精品亚洲va在线观看| 免费毛片a在线观看67194| 亚洲精品av无码喷奶水糖心| 四虎影视精品永久免费网站| a级毛片毛片免费观看永久| 亚洲国产精品xo在线观看| 亚洲AV日韩精品一区二区三区| 男女午夜24式免费视频| 亚洲精品动漫免费二区| 亚洲va国产va天堂va久久| 女人18特级一级毛片免费视频 | 中文字幕无线码中文字幕免费 | 久久精品免费观看| 一本色道久久88亚洲综合| 少妇人妻偷人精品免费视频| 亚洲精品无AMM毛片| 亚洲欧洲国产精品你懂的| 免费a级毛片在线观看| 免费A级毛片无码A∨免费| 一出一进一爽一粗一大视频免费的 | 成人免费视频77777| 久久免费国产精品| 亚洲午夜无码久久| 亚洲一区二区三区日本久久九| 一区二区三区福利视频免费观看| 亚洲av乱码一区二区三区按摩| 亚洲Av熟妇高潮30p| 国产精品永久免费10000| 一级特黄a免费大片| 久久亚洲AV成人无码国产电影 | 亚洲成av人片在线天堂无| 亚洲美女aⅴ久久久91| 国产成人综合亚洲亚洲国产第一页| 成人人免费夜夜视频观看| 免费观看国产网址你懂的| 最新久久免费视频| 人与动性xxxxx免费| 在线看亚洲十八禁网站| 亚洲七久久之综合七久久| 亚洲国产精品综合一区在线|