Hi, On Wed, Jun 29, 2011 at 11:26 AM, Guillaume Mary <[email protected]> wrote: > Hi all, > > I'm using Wicket 1.4.17 and my Wicket filter is mounted on a sub url of the > context path (I declared /MyApp/* in the url-mapping of web.xml, important > point). > > I use <img src="resources/....."> directly in the markup, without a > ResourceReference in the Java component, and suprisingly the image is not > found by the browser. If I declare a ResourceReference, it works. So I > supposed a problem in the relative path calculation during the parsing of the > html, I found RelativePathPrefixHandler class and looked at it. In its > Javadoc, it is said that paths are calculated relatively to the context path, > and that's the problem. > I found a solution, patching RelativePathPrefixHandler. > > But my question is : why this class is supposed to calculate paths relatively > to context path whereas we can mount Wicket application in a sub context ? 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>. > > (According to me this is more a bug in RelativePathPrefixHandler, and ready > to open an RFE + share my patch) > > Thanks > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
