That depends on whether the files are inside or outside your WAR.
If the file is inside the WAR, then the easiest way is to use
ScalatraFilter. Any requests that don't match a route will pass
through to the default servlet, which will serve the file. The root
of your WAR file maps to the context path of your application. If
you're using a ScalatraServlet, you can call the default servlet
explicitly by calling
servletContext.getNamedDispatcher("default").forward(request,
response).
If the file is outside your WAR, then I would return a java.io.File
object from your actions for the file to be served. You'll also need
to override renderResponseBody to copy your File object to the
response's output stream. (This should be the default framework
behavior -- I just created a ticket:
https://github.com/scalatra/scalatra/issues/issue/19).
--
Ross A. Baker
ba...@alumni.indiana.edu
Indianapolis, IN, USA
This is now the default behavior in the latest snapshot -- no need to
touch renderResponseBody.