|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ora.jsp.util.DebugBean
This class is a bean that can be used to extract debug information from a JSP PageContext. The debug info is sent to the browser, System.out, and the servlet log file, depending on the value of the "debug" request parameter sent with the request for the JSP page: "resp", "stdout" and "log". The values can be combined to get the information directed to multiple targets.
Field Summary | |
private javax.servlet.ServletContext |
context
|
private java.lang.String |
debugType
|
private static java.lang.String |
LINE_FEED
|
private javax.servlet.jsp.PageContext |
pageContext
|
private long |
startTime
|
Constructor Summary | |
DebugBean()
Creates an instance and initializes the timer. |
Method Summary | |
java.lang.String |
getApplicationScope()
Returns a String with all application scope variables. |
java.lang.String |
getCookies()
Returns a String with all cookie information. |
java.lang.String |
getElapsedTime()
Returns a String with the number of milliseconds that has passed since the bean was created or the last time this method was called. |
java.lang.String |
getHeaders()
Returns a String with all header information. |
java.lang.String |
getPageScope()
Returns a String with all page scope variables. |
java.lang.String |
getParameters()
Returns a String with all request parameter information. |
java.lang.String |
getRequestInfo()
Returns a String with all basic request information. |
java.lang.String |
getRequestScope()
Returns a String with all request scope variables. |
java.lang.String |
getSessionScope()
Returns a String with all session scope variables. |
private java.lang.String |
handleMsg(java.lang.String propName,
java.util.Hashtable values)
If debug is activated, writes the specified property value to the log file and returns it as an HTML table, depending on the requested debug type. |
private java.lang.String |
handleMsg(java.lang.String propName,
java.lang.String msg)
Returns a String suitable for browser debug display and sends the debug message to System.out and/or the servlet log file, depending on the value of the "debug" request parameter. |
private boolean |
isDebugActive()
Returns true if the pageContext attribute has been set and a valid "debug" request parameter is present in the request. |
private void |
log(java.lang.String propName,
java.util.Hashtable values)
|
private void |
log(java.lang.String propName,
java.lang.String msg)
Writes the specified property value to the System.out or the log file, depending on the requested debug type. |
private java.lang.String |
nullToString(java.lang.String value)
Returns the String "null" if the value is null, otherwise the value itself. |
void |
setPageContext(javax.servlet.jsp.PageContext pageContext)
Sets the pageContext property. |
private java.lang.String |
toHTMLTable(java.lang.String propName,
java.util.Hashtable values)
Returns an HTML table with all the values of the specified property. |
private java.lang.String |
toStringValue(java.lang.Object value)
Returns a String representation of the specified Object, in a format suitable for debug output. |
private java.lang.String |
toTabbedTable(java.util.Hashtable values)
Returns an simple ASCII table with all the values of the specified property, used for log output. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final java.lang.String LINE_FEED
private javax.servlet.jsp.PageContext pageContext
private long startTime
private java.lang.String debugType
private javax.servlet.ServletContext context
Constructor Detail |
public DebugBean()
Method Detail |
public void setPageContext(javax.servlet.jsp.PageContext pageContext)
public java.lang.String getElapsedTime()
public java.lang.String getRequestInfo()
public java.lang.String getHeaders()
public java.lang.String getCookies()
public java.lang.String getParameters()
public java.lang.String getRequestScope()
public java.lang.String getPageScope()
public java.lang.String getSessionScope()
public java.lang.String getApplicationScope()
private java.lang.String nullToString(java.lang.String value)
private boolean isDebugActive()
private java.lang.String handleMsg(java.lang.String propName, java.lang.String msg)
private java.lang.String handleMsg(java.lang.String propName, java.util.Hashtable values)
private void log(java.lang.String propName, java.lang.String msg)
private void log(java.lang.String propName, java.util.Hashtable values)
private java.lang.String toHTMLTable(java.lang.String propName, java.util.Hashtable values)
private java.lang.String toTabbedTable(java.util.Hashtable values)
private java.lang.String toStringValue(java.lang.Object value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |