Apache Struts 2 Documentation > Home > Guides > Core Developers Guide > Debugging
Added by Ted Husted, last edited by Dave Newton on Feb 16, 2008  (view change) show comment

Modern IDEs provide excellent support for debugging. In addition, the framework provides support for inspecting framework-specific objects at runtime.

The DebuggingInterceptor provides two debugging modes to provide insight into the data behind the page. The xml mode formats relevant framework objects as an XML document. The console mode provides a OGNL command line that accepts entry of runtime expressions.

To use the debugging, first be sure that struts.devMode is enabled through the struts.properties file.

  • struts.devMode = true

Then, whenever a page needs debugging, add ?debug=xml or ?debug=console to the URL.

- <debug>
  <parameters /> 
- <context>
- <struts.actionMapping>
  <class>class org.apache.struts2.dispatcher.mapper.ActionMapping</class> 
  <attr /> 
  <request /> 
  <session /> 
- <valueStack>
- <value>
  <actionErrors /> 
  <actionMessages /> 
  <class>class com.opensymphony.xwork2.ActionSupport</class> 
  <errorMessages /> 
  <errors /> 
  <fieldErrors /> 
- <locale>
  <class>class java.util.Locale</class> 
  <displayCountry>United States</displayCountry> 
  <displayName>English (United States)</displayName> 
  <displayVariant /> 
  <variant /> 
- <value>
  <class>class com.opensymphony.xwork2.DefaultTextProvider</class> 
For ?debug=xml use Internet Explorer or an IE tab in FireFox
For ?debug=console you may need to relax any popup blockers

Next: Development Mode