I am newbie to SCWCD preparation, so please correct me if I am wrong.
To me, it looks like the whole puropse of this example is to show how an object can be added in the ServletContext.
From Deployment Decscriptor, you can set only
string values.
But if you need to have a object value for a particular parameter, you need to set it via attribute class ( Dog class in the example).
Now as you mentioned, surely you can get the value of breed directly from the context, but what they are trying to demonstrates how Listeners and Attribute class can be used.