How to change domain for my assets in tapestry

给你一囗甜甜゛ 提交于 2019-12-24 21:18:02

问题


By default; the domain of all assets( js, css) is fixed which is the current domain. In order to improve the speed of website; we want to retrieve all assets using subdomain assets.example.com instead of example.com.

I checked http://tapestry.apache.org/assets.html ; where for "New domains" it is specified as

If you wish to create new domains for assets, for example to allow assets to be stored on the file system or in a database, you may define a new AssetFactory and contribute it to the AssetSource service configuration.

This was not exactly helpful as to exactly what I should do !

Any help is appreciated.


回答1:


You can take a look at the AssetPathConverter. As the documentation states

The default implementation of this is identity, the URI is passed through unchanged. Using a contribution to the ServiceOverride service, you may override the default implementation.

Hope this helps.



来源:https://stackoverflow.com/questions/14230945/how-to-change-domain-for-my-assets-in-tapestry

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!