您的位置:首页 > 其它

wicket6.18获取相对路径

2015-02-12 17:44 232 查看
wicket6.18中想获取工程路径如下:

获取工程相对路径:

String contextPath = WebApplication.get().getServletContext().getContextPath();



String contextPath =RequestCycle.get().getRequest().getContextPath();

生成工程全路径:

RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse(contextPath + "/images/0.gif"));

生成图片路径:

new Image("imgpath", new ContextRelativeResource("/images/0.gif");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: