how to use several html instead of just one hosted html

160 views
Skip to first unread message

tong123123

unread,
Aug 2, 2012, 9:43:38 PM8/2/12
to google-we...@googlegroups.com
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).

Rob

unread,
Aug 3, 2012, 7:28:31 PM8/3/12
to google-we...@googlegroups.com
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

mukarev

unread,
Aug 7, 2012, 5:42:27 PM8/7/12
to google-we...@googlegroups.com
Hi,

we solved this via having more than one gwt project and one center project for starting the application itself.

Controls and business logic is outsourced in other projects to so can be used in any module.

In case of simple and advanced search I dont't see the benfits of having more than one html container at the moment. You can explain this need further maybe.

Ahoi!
mukarev
Reply all
Reply to author
Forward
0 new messages