I'm using JSP + MVC in web application. And I found that when jQuery parse a java object, it auto call Java's toString() method. Does there's any documentation to explain why?
example, JSP use department back from controller
${departmentList }
i can see toString() log in console.
but if i use
${departmentList.name }
it will only goto
getName() //(getter method).
This is the nature of expression language evaluation. when you use expression language it will search .(dot) in it if .(dot) found it will call getter of that properties other wise call toString() of that object