March 2008
Intermediate to advanced
911 pages
20h 31m
English
Sending the result of getAttribute() to print/write statement doesn’t give us what we want—it just runs the object’s toString() method. And since class Person doesn’t override its inherited Object.toString(), well, you know what happens. But we want to print the Person’s name.
JSP code

OR using an expression
<html><body>
Person is:
<%= ((foo.Person) request.getAttribute("person")).getName() %>
</body></html>What we GOT:

But then we remember that MEMO...
The one that can be summarized as “Use Scripting and Die”
We need a different approach.
Read now
Unlock full access