This's not JSP
-specific behavior. JSP
uses JavaBeans
to access methods & properties. Here is how JavaBeans lookup a property JavaBeans Specification § 8.3.1:
By default, we use design patterns to locate properties by looking for
methods of the form:
public <PropertyType> get<PropertyName>();
public void set<PropertyName>(<PropertyType> a);
If we discover a matching pair of “get<PropertyName>” and
“set<PropertyName>” methods that take and return the same type, then
we regard these methods as defining a read-write property whose name
will be “<propertyName>”. We will use the “get<PropertyName>” method
to get the property value and the “set<PropertyName>” method to set
the property value. The pair of methods may be located either in the
same class or one may be in a base class and the other may be in a
derived class.
If we find only one of these methods, then we regard it as defining
either a read-only or a write-only property called “<propertyName>”
By default we assume that properties are neither bound nor constrained
(see Section 7).
So a simple read-write property “foo” might be represented by a pair
of methods:
public Wombat getFoo();
public void setFoo(Wombat w);