This is an automated email from the ASF dual-hosted git repository.
adelbene pushed a commit to branch wicket-8.x
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/wicket-8.x by this push:
new 3981540 WICKET-6834 Fixed guide instructions to set DEPLOYMENT mode
via code.
3981540 is described below
commit 3981540e71538a697c4112e1fd52a4968e07eb81
Author: Andrea Del Bene <[email protected]>
AuthorDate: Wed Sep 30 12:33:07 2020 +0200
WICKET-6834 Fixed guide instructions to set DEPLOYMENT mode via code.
---
wicket-user-guide/src/main/asciidoc/maven/maven_1.adoc | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/wicket-user-guide/src/main/asciidoc/maven/maven_1.adoc
b/wicket-user-guide/src/main/asciidoc/maven/maven_1.adoc
index 5aa4cf1..5994c1c 100644
--- a/wicket-user-guide/src/main/asciidoc/maven/maven_1.adoc
+++ b/wicket-user-guide/src/main/asciidoc/maven/maven_1.adoc
@@ -48,11 +48,25 @@ The third way to set the running mode is using system
property _wicket.configura
java -Dwicket.configuration=deployment ...
----
-The last option is to set it in your Java code (e.g. in the init-method of
your WebApplication):
+The last option is to override getConfigurationType() method in your class
that extends WebApplication):
[source,java]
----
-setConfigurationType(RuntimeConfigurationType.DEPLOYMENT);
+public class WicketApplication extends WebApplication
+{
+ @Override
+ public void init()
+ {
+ super.init();
+ // add your configuration here
+ }
+
+ @Override
+ public RuntimeConfigurationType getConfigurationType()
+ {
+ return RuntimeConfigurationType.DEPLOYMENT;
+ }
+}
----
Remember that system properties overwrite other settings, so they are ideal to
ensure that on production machine the running mode will be always set to
DEPLOYMENT.