Learning Vaadin

September 29th, 2013 Leave a comment Go to comments

Vaadin is a new Java web framework for making applications look great and perform well, making your users happy. Vaadin promises to make your user interfaces attractive and usable while easing your development efforts and boosting your productivity. With this book in hand you will be able to utilize the full range of development and deployment features offered by Vaadin while thoroughly understanding the concepts.

Learning Vaadin is a practical step-by-step tutorial to understanding, using, and mastering the art of RIA development with Vaadin. You will learn about the fundamental concepts that are the cornerstones of the framework, at the same time making progress on building your own web application. The book will also show you how to integrate Vaadin with other popular frameworks and how to run it on top of internal as well as externalized infrastructures.

This book will show you how to become a professional Vaadin developer by giving you a concrete foundation through diagrams, practical examples and ready-to-use source code. It will enable you to grasp all the notions behind Vaadin one step at a time: components, layouts, events, containers, and bindings. You will learn to build first-class web applications using best-of-breed technologies. You will find detailed information on how to integrate Vaadin’s presentation layer on top of other widespread technologies, such as CDI, and JPA. Finally, the book will show you how to deploy on different infrastructures like GateIn and Jelastic.

A dedicated Twitter account is available to follow news on the book.

The book is available for sale: get your own copy now!

  1. Basil Bourque
    December 1st, 2011 at 02:21 | #1

    Thanks so much writing this book.

    I wish I’d had it when I started using Vaadin. Just the first couple of chapters alone would have saved me countless hours with setting up Eclipse & getting oriented to Vaadin.

    I have one question so far. You talk about changing the /* servlet mapping in “web.xml” to /app/* and then adding a /VAADIN/* mapping. This makes sense to me, when you have more on the web site than just your Vaadin app.

    But this is not working for me. Shouldn’t I be doing something more that just editing the “web.xml” file?

    (a) Seems like I should be informing Eclipse as well, so that when I run the app inside Eclipse’s web browser, its URL adds the /app.

    (b) Seems like I should be informing Vaadin as well, or maybe not if these changes are transparent to the Vaadin app (I’m not sure).

    (c) Should I be editing the “Context root:” field in the “New Vaadin” project wizard displayed by the Vaadin-Eclipse plugin? If so, what should I put there?

    (d) What should I do to an existing app to use the /app/* URL?

    I’ve searched through the PDF of your book, but not seen the answers.

    –Basil Bourque

  2. December 1st, 2011 at 09:52 | #2

    Hi Basil,
    Thanks for your kind comment. Please note that another use-case for serving the servlet from a subcontext also is the need to properly logout a user. If you serve Vaadin from the context-root, when calling the close() method of the Application object, the Vaadin process will exit then start again.
    Now, regarding your question, just changing the /* to /anything/* should serve the Vaadin servlet from the subcontext and not the context root anymore, end of the story. If you want, you can send me your web.xml at learnvaadin at frankel dot ch and I’ll have a quick look at it.

  3. Hristo
    December 3rd, 2011 at 10:32 | #3

    Hi,

    I had exactly the same issue as Basil, and this there is an error in the book, here is what happens:
    The changes in the web.xml are fine and make sense, but with these changes, the url of the application becomes:

    http://localhost:8080/myfirstvaadinapp/app

    That is, with “/app” at the end of the url. In the screenshot in the book, it is shown without “/app”, and eclipse opens the wrong url by default, but in this case it does not open the app, but just a listing with META-INF and WEB-INF directories.

    If you do not modify the web.xml as suggested, the application is on myfirstvaadinapp
    If you modify it as suggested, it is on myfirstvaadinapp/app

    I lost a few hours on this issue… but I found an explanation here: https://vaadin.com/book/-/page/application.environment.html

    Still, it is important to know why this happens and do we have to expect to be able to open the application in the default url as in the book with some changes to the configuration of the project, the server or eclipse.

  4. December 3rd, 2011 at 10:39 | #4

    I create a reminder for a future edition of the book. Thanks!

  5. Hristo
    December 3rd, 2011 at 22:33 | #5

    Hi Nicolas,

    There is something wrong with the code at the end of chapter 5. You can check it out live here: http://cmbeta.jelastic.com/cmbeta/
    Everything is fine, submit/logout works, until you refresh the page from the browser, then it starts to fail with a strange message. Any idea how this can be fixed? The code behind is exactly as in the book… The problem is the same on the localhost within eclipse as well.

  6. December 3rd, 2011 at 23:01 | #6

    Hi,
    I never encountered this problem before. I think you should create an issue in Vaadin’s Trac (http://dev.vaadin.com/), I’m interested why this happens.

  7. Hristo
    December 4th, 2011 at 18:59 | #7

    I have isolated the bug to a very simple demo with source and live url. The ticket with the information is here: http://dev.vaadin.com/ticket/8043 This is related to the book as the same thing happens with the examples. Maybe this is a vaadin bug or we are not using it as expected(in which case the error message is not very informative).

  8. Hristo
    December 8th, 2011 at 11:16 | #8

    There is an update on the ticket above, but in a summary: it is a bug in Vaadin, but also important, working with main windows in this way is not considered a good practice, it is better to have different layouts and switch between them in the main window with setContent()

  9. December 8th, 2011 at 11:20 | #9

    What bugs me to no end is that I haven’t encountered this bug in all my Vaadin experience :-/ Thanks for the update.

  10. Hristo
    December 8th, 2011 at 11:42 | #10

    It happens only when you refresh the page from the browser, within the same session, and not in all cases. Who does that? :)

  11. Basil Bourque
    March 28th, 2012 at 23:14 | #11

    @Hristo

    I found the answer to how to change the URL (context root) of a Vaadin app (or any web app) on StackOverflow.com in Eclipse Indigo. I added exact steps and screen shots to Russ Bateman’s answer. The key is clearing/resetting the web server (ex: Tomcat) being used by Eclipse to run your app.

    http://stackoverflow.com/questions/2437465/java-how-to-change-context-root-of-a-dynamic-web-project-in-eclipse

    –Basil Bourque

  12. Basil Bourque
    March 28th, 2012 at 23:21 | #12

    Is this web page the best place for feedback on specific issues in the book?

    Page 151 (page 170 in PDF) has this line of example code:
    MethodProperty firstName = new MethodProperty(person, “firstName”);
    In my reading of the doc:
    https://vaadin.com/api/com/vaadin/data/util/MethodProperty.html
    … it seems the class type should be the type of the property’s value, not the type of the class from which we are drawing the property’s value. So that would mean both cases of should be . But then again, my experiments seem to show that either or works. That puzzles me.

    Also, I wish the book had more discussion and examples of MethodProperty, to round out my education so I know all the options/approaches available.

  1. No trackbacks yet.