Hi, On Thu, Jun 30, 2011 at 10:26 AM, guillaume.mary <[email protected]> wrote: > > Martin Grigorov-4 wrote: >> >> Because the resources are supposed to be next to WEB-INF folder. >> Wicket should handle the requests to dynamic resources (pages, >> callback listeners, etc.), while the static resources better should be >> handled by the web container. >> >> Why do you use 'resources' ? I guess because the resource is in the >> classpath. In this case you can use <wicket:link>. >> > > I agree with the point that resources should be handled by the web > container: if I write src="xxx.gif", I expect that the web container will > serve the resource. So in that case RelativePathPrefixHandler is good. > > But that's the important point: I use 'resources' in order to use the Wicket > Resource mecanism. Writing src="resources/com...../xxx.gif" makes Wicket > answering the request, without any ResourceReference declared in Java (lazy > guy !). So, for that specific case I expected that RelativePathPrefixHandler > recalculate correctly the path, going up to the wicket filter and not to the > context path. > > As I read your answer, I think that using Wicket resources url in the markup > without declaring ResourceReference is a bad practise. I just said that RelativePathPrefixHandler has different purpose and what you need is <wicket:link><img src="my.gif"/></wicket:link> It supports parent folder as well (see org.apache.wicket.settings.IResourceSettings.setParentFolderPlaceholder(String)) > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Why-RelativePathPrefixHandler-calculates-path-from-context-path-tp3632353p3634976.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
-- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
