Monday, September 19, 2011

MVP plus UiBinder example

Here you may read official google documentation for putting together MVP pattern promoted by Google for GWT development and UiBinder for xml declarative UI development for GWT. However, the example for download on this page is totally broken.

It took some time from me to fix bugs, do those features and refactorings in the source that were left undone. Here are changes to it that I made:
1. Eclipse configuration was added (.project, .classpath, .settings). GWT 2.4 and 2.4 Google
plugin were used.
2. Proper history support for editing contacts was added (ability to move back and forward
in browser to editing particular contacts, that is absent in both 1st and 2nd original examples
for MVP).
3. Black magic of native HTML for table was replaced with binded FlexTable for ContactsView
4. EditContactsView was implemented with UiBinder as well.
5. EventBus instead of non-recommended to this purpose HandlerManager was used (Such usage of HandlerManager was normal in the previous versions of GWT, but now is deprecated).
6. Code cleanup (several bugs were fixed, unused third domain object Address was removed, etc.)

You may found this fixed version of example on github.
If you are not familiar with git - just download zipped archive or a tarball - what is more appropriate for your OS and import it to Eclipse as an existing project.


  1. Thank you ! This was very helpful for piecing together UiBinder with GWT MVP pattern from the Contacts demo application.

  2. Hi there, I've imported the project but having problem with jetty, what seems to be the problem?
    2013-11-09 20:33:31.449:INFO:/uibinder-test:Unavailable javax.servlet.UnavailableException: com.sopovs.moradan.uibinder.server.ContactsServiceImpl
    2013-11-09 20:33:31.449:WARN::failed contactsServiceServlet: java.lang.NullPointerException
    2013-11-09 20:33:31.489:WARN::Failed startup of context org.mortbay.jetty.webapp.WebAppContext@70297e0d{/uibinder-test,D:\temp\isopov-mvp-uibinder-6d0d6c1\war}