|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts2.interceptor.debugging.DebuggingInterceptor
public class DebuggingInterceptor
Provides several different debugging screens to provide insight into the data behind the page. The value of the 'debug' request parameter determines the screen:
xml
- Dumps the parameters, context, session, and value
stack as an XML document.console
- Shows a popup 'OGNL Console' that allows the
user to test OGNL expressions against the value stack. The XML data from
the 'xml' mode is inserted at the top of the page.command
- Tests an OGNL expression and returns the
string result. Only used by the OGNL console.browser
Shows field values of an object specified in the
object parameter (#context by default). When the object
parameters is set, the '#' character needs to be escaped to '%23'. Like
debug=browser&object=%23parameters
Field Summary | |
---|---|
private String[] |
_ignoreKeys
|
private static String |
BROWSER_MODE
|
private static String |
COMMAND_MODE
|
private static String |
CONSOLE_MODE
|
private boolean |
consoleEnabled
|
private static String |
DEBUG_PARAM
|
private static String |
DECORATE_PARAM
|
private boolean |
devMode
|
private boolean |
enableXmlWithConsole
|
private static String |
EXPRESSION_PARAM
|
private FreemarkerManager |
freemarkerManager
|
private HashSet<String> |
ignoreKeys
|
private String[] |
ignorePrefixes
|
private static Logger |
LOG
|
private static String |
OBJECT_PARAM
|
private ReflectionProvider |
reflectionProvider
|
private static long |
serialVersionUID
|
private static String |
SESSION_KEY
|
private static String |
XML_MODE
|
Constructor Summary | |
---|---|
DebuggingInterceptor()
|
Method Summary | |
---|---|
void |
destroy()
Unused. |
private List<Object> |
filterValueStack(Map requestMap)
|
private String |
getParameter(String key)
Gets a single string from the request parameters |
void |
init()
Unused. |
String |
intercept(ActionInvocation inv)
Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the request by the ActionInvocation or to short-circuit the processing and just return a String return code. |
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<Object> stack)
Recursive function to serialize objects to XML. |
void |
setDevMode(String mode)
|
void |
setEnableXmlWithConsole(boolean enableXmlWithConsole)
|
void |
setFreemarkerManager(FreemarkerManager mgr)
|
void |
setReflectionProvider(ReflectionProvider reflectionProvider)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static final Logger LOG
private String[] ignorePrefixes
private String[] _ignoreKeys
private HashSet<String> ignoreKeys
private static final String XML_MODE
private static final String CONSOLE_MODE
private static final String COMMAND_MODE
private static final String BROWSER_MODE
private static final String SESSION_KEY
private static final String DEBUG_PARAM
private static final String OBJECT_PARAM
private static final String EXPRESSION_PARAM
private static final String DECORATE_PARAM
private boolean enableXmlWithConsole
private boolean devMode
private FreemarkerManager freemarkerManager
private boolean consoleEnabled
private ReflectionProvider reflectionProvider
Constructor Detail |
---|
public DebuggingInterceptor()
Method Detail |
---|
public void setDevMode(String mode)
public void setFreemarkerManager(FreemarkerManager mgr)
public void setReflectionProvider(ReflectionProvider reflectionProvider)
public void init()
init
in interface Interceptor
public void destroy()
destroy
in interface Interceptor
public String intercept(ActionInvocation inv) throws Exception
Interceptor
ActionInvocation
or to short-circuit the processing and just return a String return code.
intercept
in interface Interceptor
inv
- the action invocation
ActionInvocation.invoke()
, or from the interceptor itself.
Exception
- any system-level error, as defined in Action.execute()
.private String getParameter(String key)
key
- The key
protected void printContext()
protected void printContext(PrettyPrintWriter writer)
writer
- The XML writerprotected void serializeIt(Object bean, String name, PrettyPrintWriter writer, List<Object> stack)
bean
- The object you want serialized.name
- The name of the object, used for element <name/>writer
- The XML writerstack
- List of objects we're serializing since the first calling
of this function (to prevent looping on circular references).public void setEnableXmlWithConsole(boolean enableXmlWithConsole)
enableXmlWithConsole
- the enableXmlWithConsole to setprivate List<Object> filterValueStack(Map requestMap)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |