Jetty: Follow Symlinks

If you use the Open BlueDragon Ready2Run bundle, you may have encountered an issue where Jetty wouldn't follow symbolic links to static file resources (images, scripts, whatnot). In the console, it will print something like WARN: Aliased resource: file:/Users/joseph/Applications/OpenBlueDragon/webapps/openbd/app/images/foo.png==file:/Users/joseph/Projects/app/images/foo.png. The simple way to have Jetty serve the file by following the link is to add an aliases parameter to the default servlet section of ./etc/webdefault.xml file:

<servlet> <servlet-name>default</servlet-name> <servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class> ... <init-param> <param-name>aliases</param-name> <param-value>true</param-value> </init-param> ... </servlet>

When restarting with the modified XML file, it works like a champ.