views:

34

answers:

2

For debug reasons, I want to see the ouput of my ResponseWriter directly in standard output. Because the response will be processed by JavaScript I am not able to see the output there.

Is there an easy solution to redirect the ResponseWriter to standard output?

+1  A: 

There is - you can wrap your response and writer objects. But in this case there is a better solution: use Firebug. It will tell you what the response has been.

Bozho
Thanks, I just tried that also and it's really helpful
Tobo
+2  A: 

How about this?

ResponseWriter rw1, rw2; // ...
rw2 = rw1.cloneWithWriter(new PrintWriter(System.out));

Documentation for ResponseWriter

Use whichever writer your find most convenient

And finally, system.out.

Nubsis
Thank you very much, works perfectly! Now I can go on finding my bug ;)
Tobo