|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jlf.util.SessionTesterBean
A set of static methods to test and dump servlet sessions. Normally to be used from SessionTester.jsp, but can also be used from the command line (see main()) or by calling these methods directly.
All dumping methods accept an object and an output stream. The display of the object is created as HTML and written to the stream.
The code for this class taken from Java Developer's Journal, "Servlet Session Display" Volume: 5 Issue: 2, p.12, by Peter Kobak.
Constructor Summary | |
SessionTesterBean()
|
Method Summary | |
static int |
dumpSerializable(java.lang.Object sessObj,
java.io.PrintWriter out,
boolean fDeep)
Displays a (supposedly) Serializable object by attempting to write the object to determine if the object is serializable, and if so, how big the object is. |
static void |
dumpSession(javax.servlet.http.HttpSession session,
java.io.PrintWriter out,
boolean fDeep)
Diplays the content of a session, including indentification of each object stored in the session. |
static void |
main(java.lang.String[] args)
Stand-alone test for an object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SessionTesterBean()
Method Detail |
public static void dumpSession(javax.servlet.http.HttpSession session, java.io.PrintWriter out, boolean fDeep)
session
- Session to be displayed.out
- The stream to which HTML
is written.fDeep
- True to perform a dump
of each session object.public static int dumpSerializable(java.lang.Object sessObj, java.io.PrintWriter out, boolean fDeep)
The purpose of this display is to assist the developer in determining if an object can be serialized in a servlet session, and to report the size and composition of the object so it can be controlled at an early stage in the development process.
sessObj
- An object to be displayed.
Although Serializable objects
are expected, any object can
be used.
Non-serializable objects
(including non-serializable
objects embedded in
sessObj) will be reported as
such.out
- The stream to which HTML
is written.fDeep
- True to display the
fields of the object.
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |