Skip to content

2.2. Prepare Superdev Mode

domax edited this page Sep 15, 2014 · 3 revisions

Follow these steps

  1. Run server-side. You can do that in 2 ways:

    • Using built-in Jetty servlet-container - it is simplest and fastest way. Run in separate console:

       cd gwt-dynamic-main/gwt-dynamic-solid
       mvn -Psuperdev clean prepare-package jetty:run-exploded
      
    • Using devmode for gwt-dynamic-solid Maven module - this way allows you to debug server-side code:

      • Prepare stuff for Devmode:

         cd gwt-dynamic-main/gwt-dynamic-solid
         mvn -Psuperdev clean prepare-package
        
      • Create new Devmode configuration or copy it if you've got it already.

      • Add new item into classpath: gwt-dynamic-solid/src/main/profiles/server/resources

      • Place this item to the upper/first position in the classpath.

      • Run this Devmode configuration.

  2. Run Host webapp in Superdev mode in separate console (pre-configured to use port 9999):

    cd gwt-dynamic-main/gwt-dynamic-host
    mvn -Psuperdev gwt:run-codeserver
    
  3. Run each dynamic module webapps in Superdev mode. For this sample just 3 modules are available yet.

    So, run in separate console gwt-dynamic-module-foo webapp (pre-configured to use port 10000):

    cd gwt-dynamic-main/gwt-dynamic-module-foo
    mvn -Psuperdev gwt:run-codeserver
    

    Then, run in separate console gwt-dynamic-module-bar webapp (pre-configured to use port 10001):

    cd gwt-dynamic-main/gwt-dynamic-module-bar
    mvn -Psuperdev gwt:run-codeserver
    

    Finally, run in separate console gwt-dynamic-module-gwtp webapp (pre-configured to use port 10002):

    cd gwt-dynamic-main/gwt-dynamic-module-gwtp
    mvn -Psuperdev gwt:run-codeserver
    
  4. Open host webapp in browser (Chrome/Chromium is recommended): http://127.0.0.1:9999/DynamicHost/DynamicHost.html

  5. Add bookmarklets to in-place recompilation host and modules (it is optional and you may do it just once):

    • Host webapp (port 9999): javascript:%7B%20window.__gwt_bookmarklet_params%20%3D%20%7B'server_url'%3A'http%3A%2F%2F127.0.0.1%3A9999%2F'%7D%3B%20var%20s%20%3D%20document.createElement('script')%3B%20s.src%20%3D%20'http%3A%2F%2F127.0.0.1%3A9999%2Fdev_mode_on.js'%3B%20void(document.getElementsByTagName('head')%5B0%5D.appendChild(s))%3B%7D)

    • Foo Module webapp (port 10000): javascript:%7B%20window.__gwt_bookmarklet_params%20%3D%20%7B'server_url'%3A'http%3A%2F%2F127.0.0.1%3A10000%2F'%7D%3B%20var%20s%20%3D%20document.createElement('script')%3B%20s.src%20%3D%20'http%3A%2F%2F127.0.0.1%3A10000%2Fdev_mode_on.js'%3B%20void(document.getElementsByTagName('head')%5B0%5D.appendChild(s))%3B%7D)

    • Bar Module webapp (port 10001): javascript:%7B%20window.__gwt_bookmarklet_params%20%3D%20%7B'server_url'%3A'http%3A%2F%2F127.0.0.1%3A10001%2F'%7D%3B%20var%20s%20%3D%20document.createElement('script')%3B%20s.src%20%3D%20'http%3A%2F%2F127.0.0.1%3A10001%2Fdev_mode_on.js'%3B%20void(document.getElementsByTagName('head')%5B0%5D.appendChild(s))%3B%7D)

    • GWTP Module webapp (port 10002): javascript:%7B%20window.__gwt_bookmarklet_params%20%3D%20%7B'server_url'%3A'http%3A%2F%2F127.0.0.1%3A10002%2F'%7D%3B%20var%20s%20%3D%20document.createElement('script')%3B%20s.src%20%3D%20'http%3A%2F%2F127.0.0.1%3A10002%2Fdev_mode_on.js'%3B%20void(document.getElementsByTagName('head')%5B0%5D.appendChild(s))%3B%7D)

Clone this wiki locally