Loading...
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.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Embedding a HTML Page in Vaadin Panel

William Valencia Acosta
10 years ago Feb 27, 2012 9:31pm

Good Afternoon,

I have a problem and thanks to you for your help. I am trying to put a HTML Page in a Vaadin Panel, I did it in another project, but when I want to do it again, the browser page from the application wait for the cache, and reload it many times crashing the IDE, I am using this code:

ExternalResource prueba= new ExternalResource("paginas/hola.html");
Embedded browser = new Embedded("",prueba);
browser.setType(Embedded.TYPE_BROWSER);

panelJS.addComponent(browser);

And when I run it, my browser show: "Waiting for cache", and my IDE: "Waiting for http: ......./VAADIN/widgetsets/widgetsetfolder/0B80135998ECB650.cache.html" and then my IDE crash.

Please help me, thanks.

William Valencia Acosta
10 years ago Feb 28, 2012 3:08pm

Ok, I did it, I am working with a Maven Project in STS and a Vaadin archetype, the solution is:

1- Create a Widgetset file, example "myapplicationWidgetset.gwt.xml" and put it in a package.

2- Compile the widgetset file, then the folder VAADIN is created automatically with a folder named "widgetsets"; create a new folder called resources and put the JS, images, html and other resources here.

3- Run the server and type http://localhost:port/projectname/VAADIN/resources/resource.html in the browser, you can see this resource.

4- Embeed the resource with ExternalResource res=new ExternalResource("VAADIN/resource/resource.html"); and Embeeded page=...... normally.

5- Run the application and you can load pages in JavaScript with Jquery inside an Vaadin Application.

Rolo Kint
9 years ago Sep 07, 2012 6:02pm