posted 6 years ago
The HelloWorld bean has a property (a field) named 'message', and a corresponding setter method, 'setMessage'. The property name in the XML file refers to the name of the property in the HelloWorld bean, which is 'message'; not to the name of the argument variable.
Spring looks at the XML and sees that you want to set a property named 'message', so it looks for the 'setMessage' method in the HelloWorld bean, and then calls it with the value specified in the XML file.
If you'd name the property 'msg' in the XML file, it would go looking for a 'setMsg' method, and then it finds that this does not exist and throws an exception.