I want to load “pieces” of HTML to set HTMLPanels which will be dynamically modified by getting the id’s as follows:
HTMLPanel dynContent = new HTMLPanel("<div id=\"test_id\"/>");
dynContent.add(new Label("This content is dynamically generated."), "test_id");
Can I serve HTML files to my client from a GWT app (It would be cool to just load the html files served at application startup)? Or do I have to create a call to the server to get the HTML (say RPC)? It sounds like JSP is the solution but I rather stay away from this for such a simple app.
Any suggestions are welcome!
The answer is pretty neat! I first found this:
best way to externalize HTML in GWT apps?
Then tried this to load static data via Client Bundle:
Then I load the resources in my html panel:
The content from the HTML file I have is fetched and populates the HTMLPanel as I wanted.