From PHP I am used to just saving the .php file and reloading the browser after modifying the source file. How can I do this with JAVA and Jetty? When I save my webservice I currently stop the jetty server and start it again with mvn jetty:start, whats the non-complicated way of getting where I want to go?
From PHP I am used to just saving the .php file and reloading the
Share
Well, the difference between PHP and Java is that the former is an interpreter, whereas the latter is compiler-based (binary). In PHP the code is validated upon execution, whereas in Java you need to compile it first. In Java, when you use JSP-s, it is possible to just save them and reload them by hitting the refresh button in your browser (if, of course, it’s running in development mode). If you change classes, you need to restart your server. If your’re just changing web resources, you can simply define the
scanIntervalvariable for the Jetty Maven plugin. That will takes care of updating your web resources.[EDITED] Added the code from Jack Murphy’s comment below, so that it is correctly formatted.