Skip to main content

Redeployment and Live Reload

Open in ChatGPT

During development, webforJ applies saved changes to the running app and updates the browser. Class changes reach the app through a hotswap tool or through a restart. Live reload updates the browser after either.

Projects created from an archetype come configured. For an existing project, follow Spring Boot or Jetty.

How each change applies

ChangeResultReference
Java class, hotswap tool attachedThe class updates in the running app. The affected part of the page rebuilds and the app state stays.Hotswap
Java class, no hotswap toolThe app restarts. The browser reloads when the app is ready.Spring Boot, Jetty
Stylesheet or imageThe page applies it in place, without a reload.Settings
Source under src/main/frontendThe watch rebuilds it and updates the browser.Frontend watch

Settings

These settings control live reload during development:

PropertyDefaultDescription
webforj.devtools.livereload.enabledfalseTurns live reload on for development runs.
webforj.devtools.livereload.websocket-port35730Port for the browser connection.
webforj.devtools.livereload.websocket-path/webforj-devtools-wsPath for the browser connection.
webforj.devtools.livereload.static-resources-enabledtrueApplies stylesheet and image changes in place instead of reloading the page.
webforj.devtools.livereload.heartbeat-interval30000Interval in milliseconds for the connection checks that detect a restarting server.

The keys have no effect in a packaged app. Packaged apps contain no development tools.

Topics