All Packages Class Hierarchy This Package Previous Next Index
Class com.studioitech.gulli.MJDBC.E
java.lang.Object
|
+----com.studioitech.gulli.MJDBC.E
- public class E
- extends Object
A class to handle debug message. It store messages until flush()
is done, or autoflush() is called.
It is useful for servlet enviroment. During the init() phase, one
can not produce HTML output directly. So you can use E class in this way
public void init(ServletConfig config)
throws ServletException
{
super.init(config);
doYourInitWork();
E.debug("Initing done", 0);
}
// doGet Method - method that runs when the servlet is hit via GET
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
PrintWriter out;
res.setContentType("text/html");
out = res.getWriter ();
E.setOutput(out); // set output channel
E.flush(); // flush the acquired buffer, if any
E.setAutoFlush(true);// now set autoflush
doYourDoGetCode();
}
-
E()
-
-
debug(String, int)
-
Print a debug message if its associated level is less
then current DEBUG_LEVEL.
Note that:
- If autoflush is not true the message is buffered
- If autoflush is true but the PrintWriter channel
is not setted via setOutput(), the message is discarded
-
flush()
-
Print the buffer if the associated PrintWriter channel is
setted via setOutput(); In every case it frees the buffer
-
setAutoFlush(boolean)
-
set autoflush to the given boolean value
-
setDebugLevel(int)
-
set DEBUG_LEVEL to the given integer value
-
setOutput(PrintWriter)
-
set the PrintWriter to write message
E
public E()
setDebugLevel
public static void setDebugLevel(int dl)
- set DEBUG_LEVEL to the given integer value
- Parameters:
- dl - the debug level to set
setOutput
public static void setOutput(PrintWriter pw)
- set the PrintWriter to write message
- Parameters:
- pw - the PrintWriter channel to set
setAutoFlush
public static void setAutoFlush(boolean value)
- set autoflush to the given boolean value
- Parameters:
- value - the boolean value to set
debug
public static void debug(String s,
int level)
- Print a debug message if its associated level is less
then current DEBUG_LEVEL.
Note that:
- If autoflush is not true the message is buffered
- If autoflush is true but the PrintWriter channel
is not setted via setOutput(), the message is discarded
- Parameters:
- s - the string to print
- level - the debug level to set
flush
public static void flush()
- Print the buffer if the associated PrintWriter channel is
setted via setOutput(); In every case it frees the buffer
All Packages Class Hierarchy This Package Previous Next Index