On Sat, Apr 17, 2010 at 6:34 PM, John <[email protected]> wrote: > I have another question about "Mixing Projects" and > I'll post that later, if anybody is still willing to give out any > hints.
It turns out that I figured out this question for myself, but I'll post a note about it in case it helps anybody else. In my application, I have some ordinary web pages that have different GWT widgets implanted in them. Each inserted GWT widget was developed as a different, unique project. Because I was using PHP with JSON communication back and forth between server and client, the html host page was replaced with a PHP page. Using my LAMPP setup, I was able to make each project's war directory into a web document root directory, and I could develop and test just fine. When deployed, all these pages would eventually live in the same directory on the server. The problem with my test setup: PHP pages customarily share common functions, which are included as "include" files. So I either had to maintain a separate (but identical) set of include files with each project, or I had to code a "if this is a deployed app, look for include files here, or if not, look for include files in this other place". Same for shared images files, shared css files. Yuck. Also, when one page had to interact with another (like you click a link to another page), in my test setup, obviously it didn't work. Solution (probably very obvious to everyone but me): Pick one of the projects and use the war directory of this one project as compile output for all of them. When you need to divert the compile output from a project do this: Select the project and click the red suitcase button (this is Galileo eclipse, with GWT plugin remember). On the compile dialog, look in the lower left area, and open the Advanced section of the dialog. To the "additional compiler arguments", add this: -war <absolute path to war directory of project you selected as "base project"> For mine, I always ended the path entry with a file separator slash. For example, on my Linux machine: -war /home/john/workspace/GfLogin/war/ Next, copy your host page from the original project into this output directory. Also any php files required for database or json operations on the server. Also css files that might be necessary. I renamed the original host page xxxx.php.old so I wouldn't be editing it by mistake. I get confused easily. Each project will now compile its GWT javascript files into a folder named with the project name, into the designated war output folder. For development work (debugging), you will need to work on ONE project at a time, but they WILL run in the context of the complete multi-project application. When you start your development run mode, or your debug mode, select your project and either: Run as->Run Configurations... or Debug as->Debug Configurations... On the Configurations Dialog: Server tab: if you're using PHP as I am, you've got the "Run built-in server" unchecked Arguments tab: change the path that follows "-war" to be the designated output directory, no file separator on the end, example: -war /home/john/workspace/GfLogin/war You should be able to debug just fine. When you're satisfied with this project, compile it, and move on to another project (ie, another part of your application). When you deploy, you should be able to just scoop that entire war directory up to your server, with no changes. I don't know if this is helpful to anybody. If you find mistakes or have additional suggestions, maybe just add to this thread, and it might be useful to somebody. John -- 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.
