Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

can vaadin push to client app

pawel kaminski
1 decade ago Nov 16, 2010 12:09pm
Marc Englund
1 decade ago Nov 17, 2010 8:14am
pawel kaminski
1 decade ago Nov 17, 2010 8:37am
pawel kaminski
1 decade ago Nov 18, 2010 12:10pm

I manage to configure dont push and it works fine.

the problem was that running it from maven - with mvn jetty:run - it looks for VAADIN folder in source root path rather than target.

the other problem was that I should add initial params to my servlet declaration that points to created gwt.file where I point to dontpush widgetset - but it wasnt clearly described in http://vaadin.com/directory/help/using-vaadin-add-ons/maven

<init-param>
         <param-name>widgetset</param-name>
         <param-value>com.mywidgetset.DontPushWidgetSet</param-value>
      </init-param>

DontPushWidgetSet.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
   "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN"
   "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
    <inherits name="org.vaadin.dontpush.widgetset.DontpushWidgetset"/>
    <inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
</module>
Matti Tahvonen
1 decade ago Nov 18, 2010 2:53pm

Hi,

As said by Marc, I'm actually on a sick leave right now (my ankle was operated few days ago), but I guess it is good time to learn some thing new. With those nice drugs they give you after operation, it should be really easy to find "the flow" ;-)

To spend my time I tried to set up the DontPush add-on with maven. And there indeed was some traps on the way. Some of them might have been easily avoided if had used maven more before.

I started with vaadin-archetype-clean as instructed by the wiki page:
http://vaadin.com/wiki/-/wiki/Main/Using%20Vaadin%20with%20Maven

The very first thing was to switch to 6.5 nightly builds. I uncommented snapshots repositories and defined the vaadin version 6.5-SNAPSHOT.

Next I wanted to make sure I can build a widgetset with it. First followed the instructions from the Directory. I know I'd need GWT 2.1.0 so I uncommented GWT dependency and set the version version to 2.1. First problem was here. The get plugin wasn't compatible with GWT 2.1.0. With little googling and studying I set the gwt-maven-plugin version to 2.1-SNAPSHOT. When I realized that with maven I also need to create the Widgetset.gwt.xml file stub by myself I finally managed to compile the widgetset.

If course this wasn't enough. The vaadin archetype uses ancient 6.x jetty by default. Just changing the jetty version to 7.2.0.v20101020 didn't work. At some point they have renamed maven-jetty-plugin to jetty-maven-plugin. I also stripped away the version from that plugin, and some hackie settings related to some ancient maven-jetty-plugin. Also noticed that your culprit, that the webAppSourceDirectory needed to be overridden to make GWT scripts available.

Finally got it working with attached pom file. Some minor changes was also needed to the web.xml (the special servlet and widgetset) was needed.

What a fight. I have heard lots of good about maven, but IMO jee eclipse spiced with our eclipse plugin was a much easier in this case. Partly this is of course our fault because our incomplete maven support. I hope it isn't this much of a head ache with the stable branch.

cheers,
matti

pawel kaminski
1 decade ago Nov 18, 2010 3:31pm
Jean-François Lamy
1 decade ago Nov 18, 2010 3:50pm

While you are fighting with Maven, I will throw another one at you: you will see more and more people that will need, because of this whole "social" phenomenon, to combine, in a single webapp:
- a nice classical webapp
- a nice mobile app
- push / websockets

We may therefore need a way to have two servlets (one webapp, one mobile) with different widgetsets, running in the same webapp. Currently I have half a dozen add-ons in my webapp, and I don't want need that many in my touchkit app, and currently I haven't found a way to build two widgetsets and point each servlet to the proper widgetset.

Henri Sara
1 decade ago Nov 19, 2010 8:39am
pawel kaminski
1 decade ago Nov 23, 2010 11:33am
Matti Tahvonen
1 decade ago Nov 25, 2010 1:34pm

Hi,

Apparently the latest version with flash fallback for IE has broken FF. FF4 seems to work ok. If you need a working version for FF only, use the older version. Otherwise you'll need to give me some time to fix it or patch it yourself. Next time I work on this project I'll try to make loading of fallback JS/flash conditional too.

There is also a client side synchronization issue that may cause "loading indicator" to stay visible although server response is not actually pending.

BTW. Jean-Francois, I managed to solve one obstacle to your dream app. I mailed Steve that mobile Safari should support web-sockets. He responded "Soon." and gave us ios 4.2 this week :-) I just tried it and it seams to work. I'd expect Android to follow soon.

cheers,
matti