Skip to main content

Configuration

Open in ChatGPT

craftforJ is configured in webforj.conf. The property names are the same on Spring, so set them in application.properties if that's where your configuration lives.

Required properties

PropertyTypeDefaultDescription
webforj.debugBooleanfalseEnables debug mode. craftforJ requires it
webforj.devtools.craftforj.enabledBooleanfalseEnables craftforJ

Both properties must be enabled. See Security for why craftforJ requires two settings rather than one

Access

PropertyTypeDefaultDescription
webforj.devtools.craftforj.hosts-allowedList or Stringloopback onlyClient addresses allowed beyond the machine running the app

By default, only a browser on the same machine as the app can reach craftforJ. To allow other machines, list their addresses. An entry ending in * matches a prefix, and a single * removes the restriction entirely

webforj.conf
webforj.devtools.craftforj.hosts-allowed = ["192.168.1.42", "10.0.0.*"]
A wildcard allows anyone who can reach your app

craftforJ reads and writes your project sources. Only use * on a network where you're certain who can reach the port, such as a container that only you use. Never use it on a shared network.

Project root

PropertyTypeDefaultDescription
webforj.devtools.craftforj.project-rootStringdetectedThe directory your sources live in

craftforJ determines where your project is from how the app was started. Unusual project layouts and some container setups defeat that detection. If App info reports the wrong project root, set it here

Feature flags

Each of these is enabled by default. Turning one off narrows what craftforJ is allowed to do.

PropertyTurning it off removes
webforj.devtools.craftforj.source-changesWriting property changes back to Java, and changing route access
webforj.devtools.craftforj.stylesheet-changesSaving themes and styles into your stylesheet
webforj.devtools.craftforj.ai.enabledThe AI assistant
webforj.devtools.craftforj.ai.freeform-changesThe assistant writing Java of its own

Turning off a flag turns the feature off for everyone using that app. The craftforJ settings are per developer and can only narrow further, so a developer can't switch a capability back on that the app switched off.

Features you turn off stay visible

When a flag is off, the control remains in craftforJ and is marked as unsupported by the connected app.

In production

Leave webforj.devtools.craftforj.enabled unset. See Security for the full checklist.