---
title: '2 GWT Bibliotheken für REST- und MVP-Anwendungen'
url: 'https://www.tutego.de/blog/javainsel/2010/03/2-gwt-bibliotheken-fr-rest-und-mvp-anwendungen'
markdown: 'https://www.tutego.de/blog/javainsel/2010/03/2-gwt-bibliotheken-fr-rest-und-mvp-anwendungen.md'
date: '2010-03-30'
description: '1. Die History korrekt zu Implementieren ist das O und A einer GWT-Anwendung. Hier greift unter die Arme, in dem es wie bei REST Pfade einzelne GWT-Seiten mappt. Das Projekt steht am Anfang, die Idee ist aber nett für kleinere GWT-Anwendungen. Simple Example @GET@Produces("text/html")public Stri…'
taxonomy:
  category:
    - GWT
    - 'Open Source'
    - 'Web Frameworks'
---

# 2 GWT Bibliotheken für REST- und MVP-Anwendungen

![Illustration einer tropischen Insel mit Palmen und einem hohen Berg](https://www.tutego.de/blog/javainsel/user/themes/tutego/images/insel-cover.jpg)# Java Blog für Programmierer

[Java Blog für Programmierer](https://www.tutego.de/blog/javainsel/)

## 2 GWT Bibliotheken für REST- und MVP-Anwendungen

30.03.2010 · [Christian Ullenboom](https://www.tutego.de/blog/javainsel/author/admin/)

1\.

Die History korrekt zu Implementieren ist das O und A einer GWT-Anwendung. Hier greift unter die Arme, in dem es wie bei REST Pfade einzelne GWT-Seiten mappt. Das Projekt steht am Anfang, die Idee ist aber nett für kleinere GWT-Anwendungen.

> ##### Simple Example
> 
> ```java
> @GET@Produces("text/html")public String textHtmlDemo() {        return "welcome home !";}
> ```
> 
> A new gwt Label with : „welcome **home** !“ will be appended to the RootPanel.
> 
> ##### Example 2
> 
> ```java
> ```java
> @GET@Path("hello/{name}")public void helloWithIntegerParam(@PathParam("name") Integer myName) {   Window.alert("Hello "+(myName+1));}
> ```
> 
> ```
> 
> If you try to access [http://…/MyPage.html#hello/1](http://.../MyPage.html#hello/1) the helloWithIntegerParam will be invoked **on client side** with the parameter „1“. Since the return type is void, nothing will be added automatically to the Rootpanel. You will just see a popup displaying „Hello 2“.
> 
> ##### Example 3
> 
> ```java
> ```java
> @GETpublic Widget demo3() {        return new Button("Click me");}
> ```
> 
> ```
> 
> Yes, returning widgets works too !
> 
> ##### Example 4
> 
> ```java
> ```java
> @Path("search/{name}")public class Test {
> ```
> 
> `@PathParam`("name")`String` name;
> 
> ```java
> @GETpublic void search() {   myTextBox.setValue(name);}}
> ```
> 
> ```
> 
> Field initialisation is working the same way.
> 
> ##### Example 5
> 
> ```java
> ```java
> @Path("search/{name}")public class Test {
> ```
> 
> @UiField@PathParam("name")TextBox tbName;
> 
> `@GETpublic` void `search()` { // nothing here}}
> 
> ```
> 
> 
> In this special case, when a field extends „HasValue“ class, the field have to be initialized by yourself, the framework will call „setValue“ with the
> ```

2\. [http://code.google.com/p/mvp4g/](http://code.google.com/p/mvp4g/ "http://code.google.com/p/mvp4g/")

Noch eine Nummer größer als der bescheidene erste REST-Ansatz ist [http://code.google.com/p/mvp4g/](http://code.google.com/p/mvp4g/ "http://code.google.com/p/mvp4g/") aufgestellt. Es implementiert in komplettes MVP-Framework mit Event-Bus, DI, Modulen, Code-Spitting und allen Schnick und Schnack. Die Dokumentation ist mit UML-Diagrammen schon fast unwirklich. Die Einarbeitung dauert, zahlt sich jedoch aus. Eine Umstellung existierender GWT-Anwendungen ist jedoch aufwändig, da mvp4g größere Änderungen nach sich zieht.

Kategorien: [GWT](https://www.tutego.de/blog/javainsel/category/gwt/), [Open Source](https://www.tutego.de/blog/javainsel/category/open-source/), [Web Frameworks](https://www.tutego.de/blog/javainsel/category/web-frameworks/)

[← Alle Beiträge](https://www.tutego.de/blog/javainsel/)

---

## Navigation

- Previous: [objectify-appengine: schöne Abstraktion der Low-Level Datastore API](https://www.tutego.de/blog/javainsel/2010/03/objectify-appengine-schne-abstraktion-der-low-level-datastore-api.md)
