Eelco Hillenius wrote: >> I think "getContextPath" is what I need. I am trying to port my app >> to wicket 1.3 where "getContextPath" is no longer present in >> ApplicationSettings. > > I think it moved to WebApplication. > > But be sure to read this > http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html > and search the mailing list. I'm not an expert on this topic, but > there have been several discussions on this.
I am an expert on this topic, or as much of one as you'll find, anyway. ;-) Wicket 1.3 has a ContextImage component which will do what you want. Version 1.3 does a good job generally of letting you not worry about mounting things behind proxies and all this stuff, by magically generating relative URLs for you, which work just fine with mounted pages. Personally, I'd store the images outside of your webapp root and either get Wicket (use a resource) or a servlet to serve them for you. That way you can authenticate people properly and things. It's not really any extra overhead. Tomcat/whatever uses a servlet internally to serve the default images, and that's just an inputstream to outputstream copy. It may even be less overhead if you do it manually, as it won't need to worry about sniffing the mime type of the file. Nothing magic here. It's also not clear to me where your images would live if you deploy your webapp as a WAR file, or whether your user-submitted images would survive a webapp redeploy regardless of that. You should keep data outside your webapp root. Java isn't PHP. Regards, Al -- Alastair Maw Wicket-biased blog at http://herebebeasties.com ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user