It looks at the parameter type: String, Date, Long, and uses the
ValueEncoderSource service (ultimately, backed by the TypeCoercer) to find
a coercsion from String to the parameter's type.  The URL is a string, the
values in the extra path are strings, HTTP is all about strings.

By implication, if your page activation context encodes, say, a Date and
your activate event handler declares that the parameter is, say, a Long,
then you'll get a runtime exception as the string representation of a Date
is converted to a Long and fails with NumberFormatException.

I don't believe there is a built-in coercion from String to Class; if you
are not providing one, the TypeCoercer will likely fail.

I've seen people go a little crazy trying to create TheOneTrueBaseClass
rather than accept a limited amount of boilerplate and subclassing.  And
I've seen the people who have created TheOneTrueBaseClass get frustrated,
as their base class gets cluttered and complected with special cases ad
nauseum.


On Tue, Dec 25, 2012 at 3:44 AM, nhhockeyplayer nashua <
nhhockeypla...@hotmail.com> wrote:

>
> I had a fourth question...
>
> 4. how can a developer configure and specify a formal parameter to
> reliably come in during the onActivate event?
>
> Thanks
> merry christmas
>
>




-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Reply via email to