You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Mike Pilsbury <mi...@gmail.com> on 2007/03/06 21:49:25 UTC
T5: asset binding
I had a need to use a parameter binding that retrieved an asset, and was
slightly surprised to find that there is no such binding. It wasn't to
difficult to contribute such a binding, although it did take me a little
longer than I anticipated, while I dug around in the documentation and the
source.
The tapestry-core parameters page (
http://tapestry.apache.org/tapestry5/tapestry-core/guide/parameters.html)
doesn't appear to give any clues about how to contribute a binding. The
service id to contribute to would have been handy.
On the subject of service ids, is there a comprehensive list of service ids
anywhere? I stumbled around in the ioc documentation, but haven't spotted
anything.
Back to the asset binding. After implementing it, it worked nicely, and I
could use it like this.
<t:comp type="PageStyle" src="context:style/test.css"/>
The src parameter has a default binding type of 'asset'.
There is a small implementation detail that I am unhappy about. To ensure
line precise error reporting if the asset can't be located, I throw a
TapestryException. It works beautifully, but is naughty as TapestryException
is in an internal package. What is the recommended way for application code
to achieve line precise error reporting? If there isn't one, then would the
solution be to move TapestryException to a public package?