Run the application, and you will see a glorious Exception page provided by Tapestry:
If you were struggling with the obscure error messages of other frameworks, you
will greatly appreciate the clarity and precision of the Tapestry Exception page
which provides you with a wealth of information to help with debugging.
The Foundations of Tapestry
[ 54 ]
This Exception page precisely points to the line of the template that caused the
problem??”exactly the line that we have just added. It also reports that Class java.util.
Date does not contain a property named 'hashCode'. This means that Tapestry tried
to find a method named getHashCode, but couldn't. It also listed all the properties
available in the given class, but only those that are named in a standard way, and so
hashCode is not among them.
How do we display the value of the hash code then? Tapestry expansions do provide
a solution for this. If you want to call a method verbatim, let it have brackets in the
expansion. Change the recently added line of code in the template to look like this:
And here is the hash code for it: ${currentTime.hashCode()}.
Seeing the brackets, Tapestry will know that it should not look for a getHashCode
method, but call the hashCode method instead.
Pages:
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79