You can use an EntryPoint "dispatcher" if your application has multiple host pages.
public class EntryPointDispatcher implements EntryPoint {
public void onModuleLoad() {
Log.debug("EntryPointDispatcher - onModuleLoad()");
try {
// get the Host Page name
Dictionary dictionary = Dictionary.getDictionary("Pages");
String page = dictionary.get("page");
Log.debug("Page name token: " + page);
if (page.equals(NameTokens.mainPage)) {
MultiPageEntryPoint entrypoint = (MultiPageEntryPoint) GWT.create(MainPageEntryPoint.class);
entrypoint.onModuleLoad();
}
else if (page.equals(NameTokens.accountPage)) {
MultiPageEntryPoint entrypoint = (MultiPageEntryPoint) GWT.create(AccountPageEntryPoint.class);
entrypoint.onModuleLoad();
}
else if (page.equals(NameTokens.contactPage)) {
MultiPageEntryPoint entrypoint = (MultiPageEntryPoint) GWT.create(ContactPageEntryPoint.class);
entrypoint.onModuleLoad();
}
} catch (Exception e) {
Log.error("e: " + e);
e.printStackTrace();
Window.alert(e.getLocalizedMessage());
}
}
}