Gili
Gili

Reputation: 89993

How to get URL of GWT EntryPoint?

I'd like to create a Hyperlink from one GWT module to another. Instead of hard-coding a URL string, I want to programmatically convert a module class to its associated URL so that when the class is refactored it does not result in broken links. Any ideas?

UPDATE: I want to be able to look up the URL for EntryPoint "B" from inside EntryPoint "A".

Upvotes: 1

Views: 3541

Answers (2)

maneesh
maneesh

Reputation: 1701

Use GWT#getHostPageBaseURL() or GWT#getModuleBaseURL() to construct relative paths

Upvotes: 2

Jason Hall
Jason Hall

Reputation: 20920

An EntryPoint doesn't have a URL, an EntryPoint's URL is any page includes the relevant nocache.js file, which can be any number of pages in your site.

So there is no programmatic way to get the one-and-only page that includes a given EntryPoint, since it can be any page that includes the script.

Upvotes: 4

Related Questions