I am new to vaadin and somehow managed to run the application. Now I have a help.htm html file containing tips on using the application. I put the help.htm file in the WEB directory of my project in order to have access to it in the vaadin context. I tried to access it this way:
String str = "file:/" + "/" + application.getContext().getBaseDirectory() + "/help.htm"; URL url = new URL(str); Embedded browser = new Embedded("Help", new ExternalResource(url)); browser.setType(Embedded.TYPE_BROWSER); tabsheet.addComponent(browser);
I tried to debug, copy and paste the contents of the str variable into my web browser, I can access the file and the browser displays it correctly. I also tried with FileResource and ClassResource. Also, when I replace the string with http://www.somewebpage.com/, it works, but not with the code above. How to achieve this?
source share