Friday, August 3, 2012

Re: how to use several html instead of just one hosted html

Hi,

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());
    }
  }
}

->

Cheers
Rob

Kiahu.com


On Friday, August 3, 2012 11:43:38 AM UTC+10, tong123123 wrote:
although this requirement seems strange, but maybe I need to change so.
Currently, my gwt application has just one hosted html with
<script type = .... src = "....nocache.js"></script>

this is perfectly normal.
But now, I may need  to change it so that there is several html instead of this only one hosted html.
For example,
one html (or jsp) called simpeSearch.html
another html called advancedSearch.html

is it possible to much such silly change and how to do it?

In fact, I also do not know the exact reason for this change, but it seems related to embedded this search page to portlet (I do not know the detail yet).

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/dIS0ErtcPFcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment