Wicket 7.x处理外部资源目录/文件请求

时间:2015-11-26 20:40:58

标签: wicket mount

我想处理像这样的图像资源的请求:
    <img src="images?file=sub/path/to/myImage.jpg" />

键“images”是我本地硬盘上某处已安装资源的别名:
    /base/path/to/all/images
包含子目录的     sub/path/to
请求图像的位置
    myImage.jpg
位于。
所以完整的图像路径是:
    /base/path/to/all/images/sub/path/to/myImage.jpg

我尝试使用以下命令挂载请求映射器:     public void WebApplication#mount(final IRequestMapper mapper) {...}

但我真的不明白该怎么做。

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

请检查http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/和底部链接的演示应用程序。它几乎一样。