Skip to content
Advertisement

Configuring Jetty 9.2 to allow symlinks through XML file

My setup is a bit complicated, as I use JRuby with Warbler which uses Jetty 9.2.9 underneath.

Now, the docs for enabling symlinks in Jetty tell you to add this to WEB-INF/jetty-web.xml:

JavaScript

However, as far as I can tell from searching through XML files on GitHub which use AllowSymLinkAliasChecker, this snippet has to be used within a <Configure id="wac" class="org.eclipse.jetty.webapp.WebAppContext"> element.

Through Warbler I have access to only three files:

  • web.xml which has <web-app> element
  • webserver.xml which has <Configure class="org.eclipse.jetty.server.Server"> element
  • webserver.properties which defines a bunch of args for the Jetty runner

So my question is, with access to only these three files (and possibly being able to add more of them to the WEB-INF directory), how can I make Jetty follow symlinks?

Advertisement

Answer

Uff, okay, so apparently if I need to configure WebAppContext, I can just add jetty-web.xml to my WEB-INF folder and Jetty will automatically use it.

So in the end my jetty-web.xml looks like this:

JavaScript
Advertisement