Wicket DebugBar / DevUtils during production

The Wicket DebugBar from wicket-devutils adds a lot of useful information when debugging session / serialization issues. The documentation suggests that it should be added to the base page.

This approach appears to provide very little support for differentiating between development and the work environment. I don't want wicket-devutils as a production dependency, and I certainly don't want to clutter up the code with the "if development" branches.

How do Wicket people handle this in real-world applications? Are there any installed templates?

http://wicket.apache.org/apidocs/1.4/org/apache/wicket/devutils/debugbar/DebugBar.html

+4
source share
2 answers

In our case, we only add it when we enable development utilities.

 if (getApplication().getDebugSettings().isDevelopmentUtilitiesEnabled()) { add(new DebugBar("dev")); } else { add(new EmptyPanel("dev").setVisible(false)); } 

The dependence is not so great, it is easy for us to resolve it in our production dependencies.

+4
source

DebugBar already overrides isVisible . Therefore, you do not need to do anything.

 @Override public boolean isVisible() { return getApplication().getDebugSettings().isDevelopmentUtilitiesEnabled(); } 
+5
source

Source: https://habr.com/ru/post/1413506/


All Articles