Reputation: 541
I have to serve a static file (based on the request uri) from a servlet filter, if the response from the servlet has some "hint" to do so (that's not the point). So my question is, what is the best way to serve a static file from a servlet.Filter?
Upvotes: 1
Views: 2282
Reputation: 62573
There is one way: Forward the response to the static file.
EDIT
filterConfig.getServletContext().getRequestDispatcher("/path/to/static-file.jsp").forward(request, response);
Upvotes: 4