Pages Navigation Menu

Coding is much easier than you think

How to change Wicket to deployment mode

How to change Wicket to deployment mode

By default, Wicket is running in development mode. In this post we will see how to change that to Deployment mode ( commonly called as production mode ).
There is two method to change wicket to run in deployment (production) mode :

1. web.xml

The first st way is add a ‘€œconfiguration’€ context-param in web.xml.
File : web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app ... >




The system property is checked first, allowing you to add a web.xml param for deployment, and a command-line override when you want to run in development mode during development.

2. Wicket getConfigurationType()

The 2nd way is override the Wicket application getConfigurationType() method.
File : Wicket Application class

import org.apache.wicket.Application;
import org.apache.wicket.protocol.http.WebApplication;
public class WicketApplication extends WebApplication 
	public String getConfigurationType() 
		return Application.DEPLOYMENT;


Note The Wicket application always has the highest priority. For example, if web.xml is “development” and Wicket application is ‘€œdeployment’œ, Wicket will run in ‘€œdeployment’ mode.


How do I know in what mode (DEVELOPMENT/DEPLOYMENT) my application runs?

As of Wicket 1.3.0, you can call Application.getConfigurationType(). Prior to that, there is no flag telling you in which mode you are. If you want a flag subclass Application.configure() store the “configurationType” parameter in a variable.

if (DEVELOPMENT.equalsIgnoreCase(configurationType))
{"You are in DEVELOPMENT mode");
else if (DEPLOYMENT.equalsIgnoreCase(configurationType))


About Gokul

I am very much interested in android and Wicket framework. A core android developer and working in android native app development and responsive web mobile design. I have also worked in wicket fame work and java web development. I will keep on updating you about android and wicket framework and answer your query.