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");