Running GWT development mode with PHP backend on local server setup

I’m new to GWT development and trying to figure out the best local development setup. I want to build a GWT client that talks to a PHP backend using JSON for data exchange.

Right now I’m following some tutorials that say I need to:

  1. Build the GWT application first
  2. Deploy it to Apache or IIS server

This seems like a lot of extra steps every time I make changes. Is there a better way to do this during development?

I’m wondering if I can run both Jetty (for GWT dev mode) and Apache (for PHP) at the same time on my local machine. That way I could work on both the frontend and backend without having to compile and deploy constantly.

Another option I’m thinking about is whether GWT development mode can be configured to work with Apache or Tomcat instead of the default Jetty server. Has anyone tried this approach?

What’s the most efficient way to set up a local development environment for this kind of project?

yeah, ive done this setup, and its solid! just make sure to use diff ports: like 8080 for gwt and 80/8000 for apache. the tricky part is handling cross-origin stuff. i usually just add the proper headers in my php scripts - makes dev much easier!

Based on my experience, it’s indeed efficient to run GWT on Jetty and your PHP backend on Apache simultaneously using different ports. This setup allows you to make changes to both frontend and backend without the need for constant redeployment. Ensure that your Apache server is configured to handle CORS requests correctly, allowing smooth communication between the two environments. Alternatively, using Apache as a reverse proxy for Jetty can eliminate any CORS issues you may encounter. For development purposes, Jetty’s hot reload feature is invaluable, making it the ideal choice.

interesting setup! i’ve been wondering about this too - are you planning to use CORS headers for the cross-origin requests between jetty and apache? why’d you go with php instead of a servlet-based backend that could run on the same jetty instance? let me know how it works out!