How do I upload an image as a File and display it as a Thumbnail with Tapestry 5?
Using the 3rd party tapestry-upload component, I can upload a File from the client on the server.
Using the chenillekit开发者_如何学Python's thumbnail component, a can make a thumbnail from an Asset.
How can I convert my File into an Asset in order for the Thumbnail component to provide me the image thumbnail ?
There are a few threads on the mailing list that deal with this. Basically, you need to contribute a custom AssetFactory that reads the image from disk (or the database). You might also look at URIAssetFactory which is part of ChenilleKit itself.
Here are a few links to help:
https://issues.apache.org/jira/browse/TAP5-423
http://www.mail-archive.com/users@tapestry.apache.org/msg33692.html
精彩评论