Take a look at:

http://tapestry.formos.com/cgi-bin/viewvc.cgi/chenillekit/branches/1.0/chenillekit-tapestry/src/main/java/org/chenillekit/tapestry/core/factories/URIAssetFactory.java?view=markup

for an example of how to create custom Assets. But note that the approach there still requires you to implement a custom dispatcher to handle the custom-asset request. This is generally reasonable, since only you will know how to retrieve the asset specified by the incoming url. The benefit to going the asset route is that you still have opportunities for asset localization, and your assets will "snap" right into the rest of the framework.

Robert

On May 28, 2009, at 5/289:42 AM , davidb82 wrote:


Hi,

I am trying to register a custom Asset type, but I seem to have confused myself... I'm hoping somebody more intelligent than me (not hard :-)) can
help me out.

My problem is that I don't see how to get the client urls generated by the Assets I return from my AssetFactory to get correctly interpretted by the
AssetDispatcher/AssetResourceLocator. It seems as though there is a
hardcoded assumption that the Asset is either a servlet context resource or on the classpath, whereas I expected the AssetResourceLocator would somehow determine the type of the asset based on the url and retrieve the resource
by calling getRootResource() on the approrpiate AssetFactory and then
passing in the relative path to this resource supplied by the url.

Judging by the documention:
(http://tapestry.apache.org/tapestry5.1/guide/assets.html) it's possible to create assets which are, for example, stored in a database, so I'm sure I'm
missing something obvious here.

Hope someone can help.

Cheers

Dave

--
View this message in context: 
http://www.nabble.com/Question-about-AssertDispatcher-and-custom-Assets-tp23763175p23763175.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to