how can I add a robots.txt file to a Vaadin application?
I found nearly nothing related, but what I found states that there is no support for such a file.
I'm using Vaadin 7.1.1 with JBoss 7.1.1 and Vaadin-CDI-Integration.
My workaround approach is: By adding RobotsUI
to the project, the URL http://localhost:8080/App/robots.txt
becomes accessible.
@CDIUI(value="robots.txt")
public class RobotsUI extends UI {
@Override
protected void init(VaadinRequest request) {
// Send a response with mimetype
// `text/plain` with self defined content.
}
}
My problem is: How can I deliver a self-edited, text/plain
response?
Thanks for any help :-)