I am developing a project with Errai 4 and as usual I can run "mvn gwt:run" and hot reload just works, i.e. I change models or views and I only need to refresh the browser.
Now I need that but running my Errai application on top of Tomcat 7.
The project with the Tomcat is similar to https://github.com/stbland/errai-tutorial-tomcat
The question is how to make hot reload work with Tomcat 7 when I am only making changes in the front-end using only mvn gwt:run
or similar.
Step by step final solution:
Info for solve this:
- How can hot reload be enabled when running Errai on Tomcat?
- Errai 4 running on Tomcat (first answer)
Install the original project
For this example we will use the errai-tutorial
- git clone https://github.com/Tlaloc-Es/errai-tutorial.git --single-branch --branch develop
- cd errai-tutorial
- mvn install
Run on Tomcat
- git clone https://github.com/Tlaloc-Es/errai-tutorial-tomcat.git --single-branch --branch develop
- cd errai-tutorial-tomcat
- mvn tomcat7:run-war
Listening changes
- cd errai-tutorial
- mvn gwt:compile
- mvn gwt:run
Now you can open http://localhost:8080/errai-tutorial/ in your web browser
For do hot reload you will need import this class in your project:
and call it in a shorcut of this way (SuperDevModeHelper.devModeOn()
) like this: