com.opensymphony.webwork.interceptor.debugging
Class DebuggingInterceptor

java.lang.Object
  extended by com.opensymphony.webwork.interceptor.debugging.DebuggingInterceptor
All Implemented Interfaces:
com.opensymphony.xwork.interceptor.Interceptor, Serializable

public class DebuggingInterceptor
extends Object
implements com.opensymphony.xwork.interceptor.Interceptor

Provides several different debugging screens to provide insight into the data behind the page. The value of the 'debug' request parameter determines the screen.

This interceptor only is activated when devMode is enabled in webwork.properties. The 'debug' parameter is removed from the parameter list before the action is executed. All operations occur before the natural Result has a chance to execute.

The value of the 'debug' request parameter determines the screen. There's no intended extension points
 
 <action ...>
    <interceptor-ref name="debugging" />
    ....
 </action>
 
 

See Also:
Serialized Form

Constructor Summary
DebuggingInterceptor()
           
 
Method Summary
 void destroy()
          Unused.
 void init()
          Unused.
 String intercept(com.opensymphony.xwork.ActionInvocation inv)
           
protected  void printContext()
          Prints the current context to the response in XML format.
protected  void printContext(PrettyPrintWriter writer)
          Prints the current request to the existing writer.
protected  void serializeIt(Object bean, String name, PrettyPrintWriter writer, List stack)
          Recursive function to serialize objects to XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebuggingInterceptor

public DebuggingInterceptor()
Method Detail

init

public void init()
Unused.

Specified by:
init in interface com.opensymphony.xwork.interceptor.Interceptor

destroy

public void destroy()
Unused.

Specified by:
destroy in interface com.opensymphony.xwork.interceptor.Interceptor

intercept

public String intercept(com.opensymphony.xwork.ActionInvocation inv)
                 throws Exception
Specified by:
intercept in interface com.opensymphony.xwork.interceptor.Interceptor
Throws:
Exception

printContext

protected void printContext()
Prints the current context to the response in XML format.


printContext

protected void printContext(PrettyPrintWriter writer)
Prints the current request to the existing writer.

Parameters:
writer - The XML writer

serializeIt

protected void serializeIt(Object bean,
                           String name,
                           PrettyPrintWriter writer,
                           List stack)
Recursive function to serialize objects to XML. Currently it will serialize Collections, maps, Arrays, and JavaBeans. It maintains a stack of objects serialized already in the current functioncall. This is used to avoid looping (stack overflow) of circular linked objects. Struts and XWork objects are ignored.

Parameters:
bean - The object you want serialized.
name - The name of the object, used for element <name/>
writer - The XML writer
stack - List of objects we're serializing since the first calling of this function (to prevent looping on circular references).


Copyright © 2013 OpenSymphony. All Rights Reserved.