When you talk about JNLP vs. applets, are you talking about a JNLP *application* vs. an applet? If you are talking about a JNLP application, then as far as I know there is no way to communicate directly between GWT and the JNLP application. I had a similar requirement, and I eventually had the GWT application and the JNLP application talk to each other through the server. A key point to remember with JNLP applications is that they run completely independently of the web browser and so cannot talk with code running within the Javascript sandbox.
Is it acceptable if your application relies on recent versions of the Java Plugin (Java 6 Update 10 and later)? If so, you can have the best of both worlds, a JNLP applet. See: http://blogs.sun.com/javaone2008/entry/applets_reloaded for a brief description. Basically, the JNLP applet is launched via the APPLET tag and runs in the context of the web browser (just like a traditional applet). Although I have not tried this, it should be able to communicate with Javascript. I have not used it, but the GWT AI project: http://code.google.com/p/gwtai/ provides a GWT/applet integration layer. One advantage of JNLP applets over traditional applets is that, as with all JNLP applets and applications, the applet will be cached on the user's computer (eliminating the download wait after the first launch of the applet). If applet download time is why you are considering launching the applet when the GWT application starts rather than when the user requires the applet's functionality, a JNLP applet may be responsive enough so that you can launch it on-demand (eliminating the need to communicate between Javascript and the JNLP applet). As you know, using the JNLP descriptor file, you can specify how much memory your applet needs. Alternatively, as of Java 6 Update 10, you can specify how much memory your applet needs through the applet tag. See: https://jdk6.dev.java.net/plugin2/ https://jdk6.dev.java.net/plugin2/#JAVA_ARGUMENTS Tony -- Tony Strauss Designing Patterns, LLC http://www.designingpatterns.com http://blogs.designingpatterns.com On Mar 16, 3:42 am, Giuseppe Sacco <[email protected]> wrote: > Hi all, > i am approaching GWT for the first time, trying to understand how to > implement all functionalities required by my application. I currently > need to access database, so I'll have to create some widget that load > and store data via a servlet; this is not a problem. What I think > might be a problem is scanning and sending all scanned pages to the > server. In order to scan, I have an applet that I currently load via > jnlp since it require a few extensions (JAI and JAI Image I/O). I > could probably load the applet when the GWT application start, but > then, I have to communicate with the applet when the user select to > scan. > > I browsed all the archives of this forum and I found how to invoke > applet methods from GWT code, but I failed to find a way to do the > same thing when the applet is loaded via JNLP. Is there any way to > communicate with applet ran via JNLP? Moreover I use JNLP instead of > APPLET because I may specify how much RAM the jvm should use. (I need > a lot of ram for storing buffered images.) > > Otherwise, I think I have to load the applet via APPLET tag, but I > have no idea about how to deploy extensions and how to specify -Xmx > using this tag. > > Thanks, > Giuseppe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
