{"id":21444973,"url":"https://github.com/gwtboot/gwt-boot-samples","last_synced_at":"2025-07-14T18:32:07.672Z","repository":{"id":53077680,"uuid":"125770258","full_name":"gwtboot/gwt-boot-samples","owner":"gwtboot","description":"GWT Boot: Samples to check all the Starters","archived":false,"fork":false,"pushed_at":"2022-10-13T17:17:53.000Z","size":1379,"stargazers_count":35,"open_issues_count":0,"forks_count":20,"subscribers_count":9,"default_branch":"master","last_synced_at":"2023-04-04T07:54:16.192Z","etag":null,"topics":["boot","framework","gwt","java","javascript","spring-boot","starter"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gwtboot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-18T21:42:28.000Z","updated_at":"2023-03-08T09:22:14.000Z","dependencies_parsed_at":"2023-01-20T00:19:37.077Z","dependency_job_id":null,"html_url":"https://github.com/gwtboot/gwt-boot-samples","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwtboot%2Fgwt-boot-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwtboot%2Fgwt-boot-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwtboot%2Fgwt-boot-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwtboot%2Fgwt-boot-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gwtboot","download_url":"https://codeload.github.com/gwtboot/gwt-boot-samples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225991735,"owners_count":17556351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boot","framework","gwt","java","javascript","spring-boot","starter"],"created_at":"2024-11-23T02:22:14.191Z","updated_at":"2024-11-23T02:22:24.653Z","avatar_url":"https://github.com/gwtboot.png","language":"Java","readme":"# GWT Boot Samples\n\n![Build Status](https://github.com/gwtboot/gwt-boot-samples/actions/workflows/maven.yml/badge.svg)\n\nHere you can find some samples on how you can use the GWT Boot Starters in \nyour project. This quickstart document is based on following sample project: [gwt-boot-sample-basic](https://github.com/gwtboot/gwt-boot-samples/tree/master/gwt-boot-sample-basic).\n\nIntroduction article about GWT Boot Starters: [GWT Boot Starters — Bootstrap a Simple GWT Web App](https://bit.ly/GWTBootStartersFinal)\n\n# IDE\n\nYou can use IntelliJ or Eclipse / STS. To be able to use Java APT correctly please take a look on how\nto [configure Java APT with Maven](https://immutables.github.io/apt.html) in each development environment.\n\n# Quick Start\n\n## Step 1 - Create a Maven Project\n\nJust create a simple Maven Project. Add the parent project and the \nstarter dependencies. To be able to compile to JavaScript you\nneed to add _gwt-maven-plugin_ and add your GWT module name.\n\n```xml\n   \u003cparent\u003e\n      \u003cgroupId\u003ecom.github.gwtboot\u003c/groupId\u003e\n      \u003cartifactId\u003egwt-boot-starter-parent\u003c/artifactId\u003e\n      \u003cversion\u003eVERSION\u003c/version\u003e\n   \u003c/parent\u003e\n   \u003cdependencies\u003e\n      \u003cdependency\u003e\n         \u003cgroupId\u003ecom.github.gwtboot\u003c/groupId\u003e\n         \u003cartifactId\u003egwt-boot-starter\u003c/artifactId\u003e\n      \u003c/dependency\u003e\n   \u003c/dependencies\u003e\n   \u003cbuild\u003e\n      \u003cplugins\u003e\n         \u003cplugin\u003e\n            \u003cgroupId\u003enet.ltgt.gwt.maven\u003c/groupId\u003e\n            \u003cartifactId\u003egwt-maven-plugin\u003c/artifactId\u003e\n            \u003cconfiguration\u003e\n               \u003cmoduleName\u003ehello.YourModule\u003c/moduleName\u003e\n               \u003cstartupUrls\u003e\n                  \u003curl\u003e/basic/\u003c/url\u003e\n               \u003c/startupUrls\u003e\n            \u003c/configuration\u003e\n         \u003c/plugin\u003e\n      \u003c/plugins\u003e\n   \u003c/build\u003e\n```\n\n**If you are using the SNAPSHOT version of the starter** you need to add Sonatype Snapshots repository by extending or creating `\u003crepositories\u003e` section since the `gwtboot-modules` are not released yet, so the example needs to access the SNAPSHOT version of `gwtboot-modules`. \n\n```xml\n   \u003crepositories\u003e\n      \u003crepository\u003e\n         \u003cid\u003esonatype-snapshots\u003c/id\u003e\n         \u003cname\u003eSonatype Snapshots\u003c/name\u003e\n         \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots\u003c/url\u003e\n         \u003csnapshots\u003e\n            \u003cenabled\u003etrue\u003c/enabled\u003e\n            \u003cupdatePolicy\u003ealways\u003c/updatePolicy\u003e\n            \u003cchecksumPolicy\u003efail\u003c/checksumPolicy\u003e\n         \u003c/snapshots\u003e\n      \u003c/repository\u003e\n   \u003c/repositories\u003e\n```\n\n## Step 2 - Create a GWT Module Descriptor _module.gwt.xml_\n\nCreate a GWT module descriptor at _src/main_ directory. In this file\nyou describe the _EntryPoint_ class which is similar to Java Main class\nand method. Module rename-to=\"basic\" means that the JavaScript will\nbe compiled to the script _basic.nocache.js_. This module inherits\neverything from the Starter module. This JavaScript\ncan be imported in the host HTML file on the next step.\n\n```xml\n\u003cmodule rename-to=\"basic\"\u003e\n   \u003cinherits name=\"com.github.gwtboot.starter.Starter\"/\u003e\n   \u003centry-point class='hello.client.YourEntryPoint'/\u003e\n\u003c/module\u003e\n```\n\n## Step 3 - Create a Host HTML File where your JavaScript can run\n\nIn this HTML file, located at _hello/public_, your generated JavaScript will run. \nThis JavaScript can access the HTML file. In this example the generated JavaScript\nwill access the div with _id=\"helloButton\"_. \n\n```html\n\u003chtml\u003e\n\u003chead\u003e\n   \u003cmeta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"\u003e\n   \u003ctitle\u003eDemo GWT Webapp\u003c/title\u003e\n   \u003cscript type=\"text/javascript\" language=\"javascript\" \n      src=\"basic.nocache.js\" async=\"\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n   \u003cdiv id=\"helloButton\"/\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Step 4 - Create your Java Entry Point _Main_ Class\n\nThe EntryPoint is the first class which will be executed. \nIn this example it will exchange the _\"helloButton\"_ with a\nButton.\n\n```java\npackage hello.client;\n\nimport com.google.gwt.core.client.*;\nimport com.google.gwt.user.client.ui.*;\n\npublic class YourEntryPoint implements EntryPoint {\n   @Override\n   public void onModuleLoad() {\n      Button button = new Button(\"Click me\");\n      button.addClickHandler(clickEvent -\u003e { \n         Window.alert(\"Hello World!\"); \n      });\n      RootPanel.get(\"helloButton\").add(button);\n   }\n}\n\n```\n\nIn [gwt-boot-sample-basic](https://github.com/gwtboot/gwt-boot-samples/tree/master/gwt-boot-sample-basic) \nyou can take a look at the basic example in GWT.\n\nNow you are ready to start your GWT basic sample app for the first time.\n\n# Starting GWT in SuperDev Mode\n\nThe application _[gwt-boot-sample-basic](https://github.com/gwtboot/gwt-boot-samples/tree/master/gwt-boot-sample-basic)_ \nuses integrated Jetty server from GWT to deliver the HTML host file. \nThis can be done with other Servlet apps as well.\n\n## Step 1 - Run GWT DevMode to automatically compile the code\n\nFirst generate the GWT Module Descriptor and then run the GWT Dev Mode \nin SuperDev mode to be able to compile the Java code to JavaScript code \non reload in the web browser. In Maven you can run following command:\n\n```java\nmvn gwt:generate-module gwt:devmode\n```\n\nYou can just generate the module once and after that just run:\n\n```java\nmvn gwt:devmode\n```\n\n![GWT Development Mode](gwt-boot-sample-development-mode.png?raw=true \"GWT Development Mode\")\n\n## Step 2 - Run the App in your Browser\n\nNow you can copy\u0026paste the \"Copy to Clipboard\" result of the GWT Development Mode UI above. Run it on:\n\n```java\nhttp://localhost:8888/basic\n```\n\nJust reload your web app and GWT SuperDev mode will transpile your\nJava code to JavaScript on the fly. That's it, now you can develop \nyour web app with GWT incrementally and fast! \n\n## Step 3 - Debug the App in your Browser\n\nYou can debug the Java code on the browser with the help of source maps. In this example we use Google Chrome.\n\n![GWT Debug Chrome](gwt-boot-sample-debugging.png?raw=true \"GWT Debug Chrome\")\n\nEnjoy! \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwtboot%2Fgwt-boot-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgwtboot%2Fgwt-boot-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwtboot%2Fgwt-boot-samples/lists"}