Skip to content

Instantly share code, notes, and snippets.

@prayagupa
Last active December 12, 2015 09:09
Show Gist options
  • Save prayagupa/4749396 to your computer and use it in GitHub Desktop.
Save prayagupa/4749396 to your computer and use it in GitHub Desktop.
gwt_on_grails

Create-app

prayag@Prayag:~/workspace_grails/school$ grails run-app
| Resolving plugin JAR dependencies.....
> You currently already have a version of the plugin installed [resources-1.1.6]. Do you want to update to [resources-1.2.RC2]? [y,n] n
| Compiling 11 source files

| Compiling 149 source files
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
| Compiling 149 source files.
| Error Compilation error: startup failed:
/home/prayag/.grails/2.1.1/projects/school/plugins/gwt-0.8/grails-app/resourceMappers/org/codehaus/groovy/grails/plugins/gwt/GwtResourceMapper.groovy: 3: unable to resolve class org.grails.plugin.resource.mapper.MapperPhase
 @ line 3, column 1.
   import org.grails.plugin.resource.mapper.MapperPhase
   ^

/home/prayag/.grails/2.1.1/projects/school/plugins/gwt-0.8/grails-app/resourceMappers/org/codehaus/groovy/grails/plugins/gwt/GwtResourceMapper.groovy: 7: unable to resolve class org.grails.plugin.resource.mapper.MapperPhase 
 @ line 7, column 17.
       def phase = MapperPhase.MUTATION
                   ^

2 errors

Groovy, Grails and GWT (G3WT) Tutorial

prayag@Prayag:~/workspace_grails/school$ grails create-gwt-module com.zazzercode.loochs.School
| Created file src/gwt/com/zazzercode/loochs/School.gwt.xml
| Created file src/gwt/com/zazzercode/loochs/client/School.java
prayag@Prayag:~/workspace_grails/school$ grails create-gwt-page main/index.gsp com.zazzercode.loochs.School
| Environment set to development.....
> MainController does not exist - do you want to create it now? [y/n] y
| Uninstalled plugin [rest-client-builder]
| Uninstalled plugin [release]
| Created file grails-app/controllers/school/MainController.groovy
| Created file test/unit/school/MainControllerTests.groovy
| Created file grails-app/views/main/index.gsp


<html>
<head>
  <!-- Integrate with Sitemesh layouts           -->
  <meta name="layout" content="main" />

  <!--                                           -->
  <!-- Any title is fine                         -->
  <!--                                           -->
  <title>Example title (change this!)</title>

  <!--                                           -->
  <!-- This script loads your compiled module.   -->
  <!-- If you add any GWT meta tags, they must   -->
  <!-- be added before this line.                -->
  <!--                                           -->
  <script type="text/javascript" src="${resource(dir: 'gwt/com.zazzercode.loochs.School', file: 'com.zazzercode.loochs.School.nocache.js')}"></script>
</head>

<!--                                           -->
<!-- The body can have arbitrary html, or      -->
<!-- you can leave the body empty if you want  -->
<!-- to create a completely dynamic ui         -->
<!--                                           -->
<body>
  <!-- OPTIONAL: include this if you want history support -->
  <iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>

  <!-- Add the rest of the page here, or leave it -->
  <!-- blank for a completely dynamic interface.  -->
</body>
</html>
prayag@Prayag:~/workspace_grails/school$ grails run-gwt-client
| Starting the GWT hosted mode client.....

Ref http://www.lazywithclass.com/code/4/gwt-on-grails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment