The first letter case of the EL expression

Source: Internet
Author: User
Tags throw exception

The EL expression Gets the object property in the same way: the expression ${user.name} is an example of an El expression that finds the Get method of the name in the user class based on name, and automatically capitalizes the name and the get prefix, once the matching method is found, The EL expression considers this to be the property to be accessed and returns the value of the property. So, to get the value of an object's property through an El expression, this property must have a corresponding get method.

So this is not about the private property, it is called the Get/set method of the private property.
If you don't write the Get/set method, the El expression will not get the value. The set method is used to set values for your background.
 Public String GetName () {        return "aaaaaaaa";}  Public String GETABCCCC () {        return "ABCCCCCCC";    }  Public String Getabcd () {        return "ABCD";}
< BR > ${name}---------${name} will directly error, El expression throws an exception, according to the results of the following line, when the first letter of the El expression uppercase, will determine the second letter case, lowercase throw exception, uppercase is directly stitching get, Form Getter Method
< BR > ${ABCCCC}--------${ABCCCC} cannot get value
< BR >${ABCD}

Summarize

When the first letter of the El expression is capitalized, it will judge the second letter case, lowercase, throw exception, uppercase, then directly stitching get, form getter method
When
the first letter of the El expression is lowercase, the second letter is case-uppercase, the first letter must be capitalized; otherwise, the value cannot be obtained.
El First letter uppercase, at least the second letter must be capitalized.

The first letter case of the EL expression

Related Article

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.