0

I use Resin webserevr. There is great FileServlet class for serving static content. I'd like to remap URIs like

/user1/file.txt -> /users/dir1/1/file.txt
/user2/file.txt -> /users/dir2/22/file.txt
...

in runtime.

But username->path mapping is not static and based on some database data.

maxp
  • 5,454
  • 7
  • 28
  • 30

1 Answers1

0

You would map your /user URLs to a servlet, which would in turn forward the request to Resin's FileServlet

   final String actualFilePath = dao.getFilePathFor("/user1/file.txt");
   final RequestDispatcher disp = request.getRequestDispatcher("/mystaticmapping" + actualFilePath);
   disp.include(request, response);
Jonathan Feinberg
  • 44,698
  • 7
  • 80
  • 103