Showing posts with label debug. Show all posts
Showing posts with label debug. Show all posts

Wednesday, 19 January 2011

Help debugging Struts 2

They say you learn something everyday, but today I genuinely did !

It turns out that there is a plugin included in the Struts 2 distributation that lets you browse the loaded configuration. This includes:

  • Configuration settings
  • Loaded jars
  • Namespaces
  • Mapped actions for each namespace
  • Interceptor stacks
  • Validation hooks 
  • and many other useful things.

So, to make it work, you simply drop struts-config-browser-plugin-2.x.x.jar into your application path, and restart your app. You can then go visit: http://yourhost/yourapp/config-browser/index and there it is !

NB: If you are using sitemesh or equivalent with a global /* decorator, you may see some odd rendering. I had to change my config around a bit to prevent sitemesh decorating these pages.

Warning: This may seem obvious, but ... make sure you don't put this out into production (or even QA for that matter).

The full details on how this works can be found here: http://struts.apache.org/2.2.1/docs/debugging-struts.html

Monday, 29 March 2010

Debugging Custom Install4j Screens

Install4J is a great bit of, Java based, installer software from a company called EJ Technologies (who also happen to publish the fanstastic JProfiler profiling tool) .

As part of the install process, you can create custom Java 'screens' that allow for the addition of non-standard functionality. These work really well, but what if you ever need to debug a screen in your IDE ?

Fortunately, there's a relatively simple way to do this, see here: http://resources.ej-technologies.com/install4j/help/api/