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?

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


Thanks Marco. I was able to get it working using Link!