there is no best practices because there is no standard way of packaging images in webapps, and so there are many ways to solve the problem.
if you are packing all your images under WEB-INF/images: you cannot serve images straight out of WEB-INF, so you will have to create a servlet. map it to /images/* and away you go. alternatively you can simply put your images under webapp/images instead of webapp/WEB-INF/images and access them using the static image tag you provided as an example. -igor On Mon, Nov 23, 2009 at 6:01 PM, Alec Swan <[email protected]> wrote: > I am relatively new to Wicket and currently using Wicket 1.4.2 with Tomcat > 6.0. > > I would like to understand the recommended way of handling static images > with Wicket in production. Suppose I have the following image: > > <img src="/images/logo.gif" alt="Company Logo" /> > > This image is static and do not want to create a wicket:id for it and change > the Java code to set up. > > What are my options here? Should I configure Wicket to map /images folder to > WEB-INF/images? Or should I configure a filter in web.xml to do that? Or > should I run a web server which handles /images URL? > > What is the recommended option for production or development? Is there any > tutorial that explains how to organize Wicket source code and image resource > directories and tie them together? > > Thanks, > > Alec > > P.S. I read Wicket FAQ and other online resources, but no central place that > describes best practices. Even in Wicket In Action almost all images have > wicket:id which puts a lot of burden on the Java developer. > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
