Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
How to open a file in web browser?
Hello all. I'm new to Vaadin so bare with me. I'm simply trying to open an XML file in a web browser and am having diffuculty. I have an XML file that lives here: C:\Users\user\workspaceluna\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\EVOLtWeb\WEB-INF\xmlfiles\user.xml. I just want it to open in a new tab or window and display the xml file. This is what I have currently:
this.details.setTargetName("_blank");
this.details = new ActiveLink("LINK", new ExternalResource(VaadinService.getCurrent().getBaseDirectory().getAbsolutePath() + "\\WEB-INF\\xmlfiles\\" + user + ".xml"));
Can anyone please point me in the right direction?
Hi,
it seems you are using an addon in your code.
If you only need to open a file in a new window you can either use a Link component or a BrowserWindowOpener extension.
Take a look at the Link documentation.
HTH
Marco
Thanks Marco. I was able to get it working using Link!