On Thursday, February 10, 2011 6:11:51 PM UTC+1, Paul Smith wrote:
>
> I was just wondering if anyone has tried to put the bootstrap js straight 
> into the host page.
>

Yes. I just use a <jsp:include page="myapp/myapp.nocache.js" flush="true" /> 
in my host page, which is a JSP.
 
However, because the script isn't then loaded from the myapp folder, it 
doesn't resolve the paths to the *.cache.html correctly. There are two 
solutions:

   - put your JSP in the same folder as the generated GWT JS code (which 
   means you'll probably put it in the 'public' path of your GWT module)
   - add the following to your HTML so the bootstrap code can generate 
   appropriate links to the *.cache.html files: <meta name=gwt:property 
   content='baseUrl=<%= 
   
java.net.URI.create(request.getRequestURL().toString()).resolve("myapp/").toASCIIString()
 
   %>'>

There are of course other ways to achieve it (e.g. using a linker to 
directly output your host page with the bootstrap code in it) but this is 
probably the Simplest Thing That Could Possibly Work™

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to