Comment faire passer Wicket en mode de déploiement?
Problème
Par défaut, Wicket fonctionne en mode développement. Comment passer en mode production?
WebApplication:759 - [WicketApplication] Started Wicket version 1.4.17 in development mode ******************************************************************** *** WARNING: Wicket is running in DEVELOPMENT mode. *** *** ^^^^^^^^^^^ *** *** Do NOT deploy to your live server(s) without changing this. *** *** See Application#getConfigurationType() for more information. *** ********************************************************************
Solution
Comme je le sais, il existe deux façons de modifier Wicket pour qu'il s'exécute en mode de déploiement (production):
WebApplication:759 - [WicketApplication] Started Wicket version 1.4.17 in deployment mode
1. web.xml
La première méthode consiste à ajouter un paramètre de contexte «configuration» dans web.xml.
Fichier: web.xml
... configuration deployment
2. Wicket getConfigurationType ()
La deuxième méthode consiste à remplacer la méthodegetConfigurationType()
de l'application Wicket.
Fichier: classe d'application Wicket
import org.apache.wicket.Application; import org.apache.wicket.protocol.http.WebApplication; public class WicketApplication extends WebApplication { @Override public String getConfigurationType() { return Application.DEPLOYMENT; } }
Note
L'application Wicket a toujours la priorité la plus élevée. Par exemple, si web.xml est «development» et l'application Wicket est «deployment», Wicket fonctionnera en mode «deployment».