Use ognl expressions

Source: Internet
Author: User
<Li> common attribute of the action in the Access value Stack: username = <s: property value = "username"/> </LI> <li> access the common attributes of objects in the value stack (Get Set Method): <s: property value = "user. age "/> | <s: property value =" User ['age'] "/> | <s: property value = "User [\" Age \ "]"/> | wrong: <% -- <s: property value = "User [age]"/> -- %> </LI> <li> access the common attributes of objects in the value stack (Get Set Method): <s: property value = "cat. friend. name "/> </LI> <li> common method for accessing objects in the value Stack: <s: property value =" password. length () "/> </LI> <li> Usage: <s: property value = "cat. miaomiao () "/> </LI> <li> common method for accessing action in the value Stack: <s: property value =" m () "/> </LI> <HR/> <li> static access method: <s: property value =" @ COM. bjsxt. struts2.ognl. s @ s () "/> </LI> <li> access static properties: <s: property value =" @ COM. bjsxt. struts2.ognl. s @ Str "/> </LI> <li> static method for accessing the math class: <s: property value =" @ max) "/> </LI> <HR/> <li> constructor for accessing common classes: <s: property value =" new COM. bjsxt. struts2.ognl. user (8) "/> </LI> <HR/> <li> access list: <s: Prope Rty value = "users"/> </LI> <li> access an element in the list: <s: property value = "users [1]"/> </LI> <li> access the set of an attribute in the list element: <s: property value = "users. {age} "/> </LI> <li> access the specific value of an attribute set in the list element: <s: property value =" users. {age} [0] "/> | <s: property value =" users [0]. age "/> </LI> <li> access set: <s: property value =" dogs "/> </LI> <li> access an element in the Set: <s: property value = "Dogs [1]"/> </LI> the set cannot be obtained. <li> Access Map: <s: property value = "dogmap"/> </LI> <li> access an element in map: <s: Pr Operty value = "dogmap. dog101 "/> | <s: property value =" dogmap ['dog101 '] "/> | <s: property value = "dogmap [\" dog101 \ "]"/> </LI> <li> access all keys in map: <s: property value = "dogmap. keys "/> </LI> <li> access all values in map: <s: property value =" dogmap. values "/> </LI> <li> access container size: <s: property value =" dogmap. size () "/> | <s: property value =" users. size "/> </LI> <HR/> <li> projection (filter): <s: property value =" users. {? # This. age = 1} [0] "/> </LI> <li> projection: <s: property value =" users. {^ # This. age> 1 }. {age} "/> </LI> <li> projection: <s: property value =" users. {$ # This. age> 1 }. {age} "/> </LI> <li> projection: <s: property value =" users. {$ # This. age> 1 }. {age }== null "/> </LI> <HR/> <li> []: <s: property value =" [0]. username "/> </LI>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.