Config Files
JSON format description
There are 3 config files:
Configuration File Organization
The JSON configuration file is organized by the unique URL endpoints. Each URL endpoint has therefore its own configuration. This can be seen in the Webswing binary distribution webswing.config file:
{
"/" : {
"path" : "/",
"security" : ...
},
...
},
"/swingset3" : {
"path" : "/swingset3",
"name" : "SwingSet3",
"security" : {...},
...
"swingConfig" : {
...
"launcherType" : "Desktop",
"launcherConfig" : {
"mainClass" : "com.sun.swingset3.SwingSet3",
"args" : null
},
},
},
"/netbeans" : {
"path" : "/netbeans",
...
},
"/applet" : {
"path" : "/applet",
...
},
"/javafx" : {
"path" : "/javafx",
...
}
Variable resolution
Most of the text options support variable replacement. Available variables are Java system properties, OS environment variables, and a set of special Webswing variables. Variables are specified with dollar followed by variable name in curly brackets. For example, ${variable_name}.
In additions to variables, for classPathEntries properties it is possible to use wild-card characters. Supported wild-cards are * (everything) and ? (any singe character).
Available variables:
| Variable Name | Description |
|---|---|
${user} |
Webswing specific logged in user name. |
${clientId} |
Webswing specific unique browser identifier. |
${clientIp} |
IP address of browser that started this application. |
${clientLocale} |
Locale of browser that started this application. |
${clientTimeZone} |
Time zone of browser that started this application. |
${customArgs} |
Custom Arguments specified in URL parameters. See details |
| Java system Properties | All properties accessible to server's JVM using System.getProperty method |
| System environment variables | All OS level environment variables accessible to script that started Webswing server JVM. |
In Admin Console, options which support variable replacement show with a flash icon. Click on the flash icon shows the resolved value:

Variable validation
You can define a custom regular expression to validate a variable value at the time the variable is being resolved, i.e. when starting the application instance. Webswing will fail to start the application instance in case the variable validation fails.
To define a variable validator, add a key-value pair in webswing.properties file or provide it as a system property when starting Webswing Server:
webswing.argsValidator=[A-Z][A-Z0-9_]*
Use the validator in configuration like this:

Standalone Webswing configuration
This is a configuration file for Webswing standalone. By default webswing.config is located in Webswing root folder.
{
"/": {
ServerConfig
},
"/example-app": {
SecuredPathConfig
"swingConfig": {
SwingConfig
}
}
}
ServerConfig
SecuredPathConfig
SwingConfig
Example of webswing.config with default values:
{
"/": {
"webHomeDir": "${user.dir}",
"webFolder": "",
"langFolder": ""
},
"/example-app": {
"enabled": true,
"name": "My Application",
"webHomeDir": "${user.dir}",
"webFolder": "",
"langFolder": "",
"sessionMode": "CONTINUE_FOR_BROWSER",
"maxClients": "1",
"maxClientsPerUser": "-1",
"maxLinkedUsersPerSession": "-1",
"allowStealSession": true,
"autoLogout": true,
"goodbyeUrl": "",
"monitorEdtEnabled": true,
"loadingAnimationDelay": 2,
"recordingAllowed": true,
"recordingConsentRequired": false,
"mirroringAllowed": true,
"mirroringConsentRequired": false,
"uploadMaxSize": 5
"swingConfig": {
"enabled": true,
"homeDir": "${user.dir}",
"theme": "",
"directdraw": true,
"debug": false,
"testMode": false,
"userDir": "",
"jreExecutable": "${java.home}/bin/java",
"javaVersion": "${java.version}",
"javaFx": false,
"javaFxVersion": "11",
"javaFxEmbeddedInJdk": false,
"launcherType": "Desktop",
"prelaunchType": "NONE",
"swingSessionTimeout": 300,
"timeoutIfInactive": false,
"inactivityAction": "SHUTDOWN",
"idleInstancesCount": 0,
"sessionLogging": false,
"sessionLogMaxFileSize": "${webswing.sessionLog.maxSize:-1000MB}",
"sessionLogFileSize": "${webswing.sessionLog.size:-10MB}",
"allowStatisticsLogging": true,
"isolatedFs": true,
"allowUpload": true,
"allowDelete": true,
"allowDownload": true,
"allowAutoDownload": false,
"transparentFileOpen": true,
"transparentFileSave": true,
"transferDir": "${user}/upload",
"clearTransferDir": true,
"threadDumpsFolder": "${" + Constants.ROOT_DIR_PATH + "}/datastore/dumps",
"recordingsFolder": "${" + Constants.ROOT_DIR_PATH + "}/datastore/recordings",
"allowJsLink": false,
"allowLocalClipboard": true,
"allowServerPrinting": false,
"fontEmbeddingEnabled": false,
"dockMode": "NONE",
"dockType": "POPUP",
"multiScreenSupportEnabled": false
}
}
}
Cluster Web configuration
This is a configuration file for Webswing Cluster application related to Cluster Server. Available only in cluster version. Configuration is managed by Webswing Admin Console server. By default webswing-server.config is located in Cluster server root folder.
{
"/": {
ServerConfig
},
"/example-app": {
SecuredPathConfig
}
}
Example of webswing-server.config with default values:
{
"/": {
"webHomeDir": "${user.dir}",
"webFolder": "",
"langFolder": ""
},
"/example-app": {
"enabled": true,
"name": "My Application",
"webHomeDir": "${user.dir}",
"webFolder": "",
"langFolder": "",
"sessionMode": "CONTINUE_FOR_BROWSER",
"maxClients": "1",
"maxClientsPerUser": "-1",
"maxLinkedUsersPerSession": "-1",
"allowStealSession": true,
"autoLogout": true,
"goodbyeUrl": "",
"monitorEdtEnabled": true,
"loadingAnimationDelay": 2,
"recordingAllowed": true,
"recordingConsentRequired": false,
"mirroringAllowed": true,
"mirroringConsentRequired": false,
"uploadMaxSize": 5
}
}
Cluster App configuration
This is a configuration file for Webswing Cluster application related to Session Pool. Available only in cluster version. Configuration is managed by Webswing Admin Console server. By default webswing-app.config is located in Session Pool root folder.
{
"/example-app": {
SwingConfig
}
}
Example of webswing-app.config with default values:
{
"/example-app": {
"enabled": true,
"homeDir": "${user.dir}",
"theme": "",
"directdraw": true,
"debug": false,
"testMode": false,
"userDir": "",
"jreExecutable": "${java.home}/bin/java",
"javaVersion": "${java.version}",
"javaFx": false,
"javaFxVersion": "11",
"javaFxEmbeddedInJdk": false,
"launcherType": "Desktop",
"prelaunchType": "NONE",
"swingSessionTimeout": 300,
"timeoutIfInactive": false,
"inactivityAction": "SHUTDOWN",
"idleInstancesCount": 0,
"sessionLogging": false,
"sessionLogMaxFileSize": "${webswing.sessionLog.maxSize:-1000MB}",
"sessionLogFileSize": "${webswing.sessionLog.size:-10MB}",
"allowStatisticsLogging": true,
"isolatedFs": true,
"allowUpload": true,
"allowDelete": true,
"allowDownload": true,
"allowAutoDownload": false,
"transparentFileOpen": true,
"transparentFileSave": true,
"transferDir": "${user}/upload",
"clearTransferDir": true,
"threadDumpsFolder": "${" + Constants.ROOT_DIR_PATH + "}/datastore/dumps",
"recordingsFolder": "${" + Constants.ROOT_DIR_PATH + "}/datastore/recordings",
"allowJsLink": false,
"allowLocalClipboard": true,
"allowServerPrinting": false,
"fontEmbeddingEnabled": false,
"dockMode": "NONE",
"dockType": "POPUP",
"multiScreenSupportEnabled": false
}
}
Cluster Autoscaling configuration
This is a configuration file for Webswing Cluster autoscaling. Available only in cluster version. Autoscaling is managed by Webswing Admin Console server. By default webswing-autoscaling.config is located in Admin Console server root folder.
{
"/": {
AutoScalingConfig
}
}
Example of webswing-autoscaling.config with default values:
{
"/": {
"enabled": false,
"homeDir": "${user.dir}",
"minSessionPools": 1,
"startSessionPoolScriptTimeout": 300,
"stopSessionPoolScriptTimeout": 300,
"autoScalingSessionPoolAlgorithmModule": "DEFAULT"
}
}