Javascript-use of EL expressions

Source: Internet
Author: User
Today, I found two methods in the el expression in the code. I don't know if it can be used like this, but no error is reported and the value can be obtained correctly. The first one: the second one: this is the final Subtotal (only this one is changed), so we can get the value. What are the regions of the two types... today, I found two methods in the el expression in the code. I don't know if it can be used like this, but no error is reported and the value can be obtained correctly.

First:

I believe that when you read the document (pay attention to the selected part), you will know that direct access to properties does not mean that the EL expression has the permission to access the private attribute of a JavaBean, instead, the data is obtained by automatically calling the getProperty method.

In your question, since $ {orderItem. getSubtotal ()} is available, it indicates that you actually provide the getter method, you can also directly obtain data using the attribute name.

To be accurate, the attribute name is used to obtain the data through the getter method.

In fact, the specific implementation of the first writing method is also a callGetSubtotal ()There is no difference between the two methods.

*. Abc *. getAbc ()

No difference,After. abc is processed, it still becomes. GetAbc ()
In this way, we can draw a conclusion that all getter methods can be set to. attribute values.

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.