Capture browser request for resources and respond dynamically

I have a requirement to capture the specific href browser request and respond to that requested resource dynamically without having that resource pre-exists in the application.

For example, we have the following CSS link in the application HTTP header

Here this foo.css file does not exists in the application, instead I want to generate this file content on the fly and return that generated foo.css for the request that was sent from the browser for the above href (may be by capturing the corresponding output steam and writing the foo.css content onto that).

Is it possible and how to achieve this in Vaadin?


Create an HttpServlet and pop its mapping in to your web.xml file.