Summary

 < Free Open Study > 



We started this chapter by listing some of the problems associated with servlet development that make servlet debugging different from traditional debugging. We don't want our application to be adversely affected by simply observing it, which established that non-invasive techniques were the preferred approach to debugging web applications.

We demonstrated the usefulness of filters and event listeners by developing some simple non-invasive debugging components that could be added to any web application. These components were used to capture information about how a web application operates. As an alternative, we looked at the Java Platform Debugger Architecture (which is not part of the Servlets API). We saw how the JPDA offers greater debugging possibilities but at the cost of additional complexity and performance degradation.

For each of the techniques we produced debugging output in a consistent tagged format that lent itself to visualization and further processing. The TraceViewer class provided a simple example of this.

After comparing the three approaches, with filters and events listener coming out (just about) on top, we discussed how they could be brought together into a flexible debugging architecture based on the J2SE 1.4 Logging API.

Finally we looked briefly, at the idea of a novel runtime reverse-engineering tool, based entirely on what we covered in this chapter.

In the next chapter we'll look at some real-life servlet problems involving class loading and synchronization that can be investigated using the techniques we've learnt.

C

ConsoleHandler

  • Handler object, 22

coupling mechanism

  • debugging components, 22

D

debug trace

  • sample visualizations, 18

  • visualizing, 18

DebugFilter

  • debugging filter, 3

debugging

  • components, coupling with J2SE 1.4, 22

  • debug mode, running server in, 16

  • debug trace, visualizing, 18

  • formatting output with J2SE 1.4, 23

  • logging enhancements, J2SE 1.4, 22

  • runtime reverse engineering with UML, 24

  • servlet debugging issues/techniques, 1

  • Tomcat servlet container options, 16

debugging listener

  • implementing, 7

  • interfaces implemented, 7

  • using, 9

debugging techniques/tools, 2

  • choosing technique, 20

  • commercial debugging tools, problems with, 2

  • DebugFilter, 3

  • event driven debugging, 3

  • event listeners, 7

  • filters, 3

    • choosing debugging technique, 21

    • implementing, 3

    • using, 6

  • Integrated Development Environment tools, 2

  • invasive/non-invasive techniques, 2

  • JBuilder IDE tool, 2

  • JDB debugging tool, 3

  • JPDA, debugging with, 10

  • VisualAge IDE tool, 2

doFilter() method, DebugFilter class

  • implementing debugging filter, 4

  • visualizing debug trace, 19

doGet() method

  • debugging, 4

doPost() method

  • debugging, 4

duration> element

  • debugging filter, using, 6

  • debugging listener, using, 10

E

elements

  • duration> element, 6, 10

  • invocation> element, 6, 10, 17

  • listener> element, 9

  • message> element, 6, 10, 17

  • receiver> element, 6, 10, 17

  • sender> element, 6, 10, 17

  • thread> element, 17

event driven debugging, 3

event listener

  • interfaces implemented, 7

event listeners

  • choosing debugging technique, 21

  • debugging listener, 7

F

FileHandler

  • Handler object, 22

filter> element

  • debugging filter, using, 6

filter-mapping> element

  • debugging filter, using, 6

filters

  • !see also debugging filters.

  • !see also debugging techniques/tools.

  • debugging technique, 3

formatters

  • formatting debugging output with J2SE 1.4, 23

  • SimpleFormatter, 23

  • XMLFormatter, 23

H

Handler object

  • logging enhancements J2SE 1.4, 22

HttpSessionAttributeListener interface

  • debugging listener, 7

HttpSessionListener interface

  • debugging listener, 7

I

interfaces

  • HttpSessionAttributeListener interface, 7

  • HttpSessionListener interface, 7

  • implemented by debugging listener, 7

  • ServletContextAttributeListener interface, 7

  • ServletContextListener interface, 7

invocation> element

  • debugging filter, using, 6

  • debugging listener, using, 10

  • JPDA debugger output, 17

J

J2SE 1.4

  • formatting debugging output with, 23

  • logging enhancements, 22

Java Debug Interface (JDI)

  • JPDA, 10

Java Debug Wire Protocol (JDWP)

  • JPDA, 10

Java Virtual Machine Debug Interface (JVMDI)

  • JPDA, 10

JBuilder IDE

  • debugging tools, 2

JPDA (Java Platform Debugger Architecture)

  • choosing debugging technique, 21

  • constituent parts, 10

  • debugging with, 10

JPDA debugger

  • implementing, 11

  • output, 17

  • using, 16

JPDADebugger class

  • class entry point, 11

  • compiling, 11

  • inspecting servlet container while running, 16

  • JPDA debugger, 11

  • processMethodEntryEvent() method, 14

L

listener> element

  • debugging listener, 9

logging

  • !see also debugging, 22

logging enhancements J2SE 1.4, 22

  • coupling debugging components with J2SE 1.4, 22

  • Handler object, 22

M

MemoryHandler

  • Handler object, 22

message> element

  • debugging filter, using, 6

  • debugging listener, using, 10

  • JPDA debugger output, 17

methods

  • processMethodEntryEvent() method, 14

P

processMethodEntryEvent() method

  • JPDADebugger class, 14

R

receiver> element

  • debugging filter, using, 6

  • debugging listener, using, 10

  • JPDA debugger output, 17

reverse engineering

  • runtime, with UML, 24

S

sender> element

  • debugging filter, using, 6

  • debugging listener, using, 10

  • JPDA debugger output, 17

service() method

  • debugging, 4

servlet container

  • inspecting while running, 16

  • Tomcat options, 16

servlet debugging see debugging.

ServletContextAttributeListener interface

  • debugging listener, 7

ServletContextListener interface

  • debugging listener, 7

SimpleFormatter

  • formatter, 23

SocketHandler

  • Handler object, 22

StreamHandler

  • Handler object, 22

T

thread> element

  • JPDA debugger output, 17

Tomcat

  • servlet container options, 16

TraceViewer class

  • formatting debugging output, 23

U

UML

  • runtime reverse engineering, 24

V

VisualAge IDE

  • debugging tools, 2

X

XMLFormatter

  • formatter, 23



 < Free Open Study > 



Professional Java Servlets 2.3
Professional Java Servlets 2.3
ISBN: 186100561X
EAN: 2147483647
Year: 2006
Pages: 130

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net