Is it possible to serve non-html content from a UI?
[i]
public class ObjectResource extends UI {
public static class Servlet extends VaadinServlet { }
@Override
public void init(VaadinRequest request) {
VaadinService.currentResponse.setContentType("someother/mimetype");
response.getWriter().append("my content");
[/i]
}
}
This clearly doesn’t work. I can get the kind of output behaviour I want by using a
ContentHandler , however not I’ve worked out how to utilise that functionality directly so that it fires when the app is fire run, rather than in a subsequent request.
Is this possible?
The reason I need something like this, is that I want to support an end point that serves content to an external browser which doesn’t support java script. The main app sets up some content (backed by a database), and the slave browser can consume it with a single HTTP request.