1

Is there a way to intercept and record every JSON message exchanged between a Eclipse RAP-Client and a RAP-Server?

nap.gab
  • 451
  • 4
  • 19

1 Answers1

2

The best way to do this is a servlet filter. See this answer for an example how to read the response in a filter.

As an alternative, you could register a PhaseListener and try to hook into RWT's internal APIs such as ClientMessage and ProtocolMessageWriter. However, these internals are subject to change and even the PhaseListener interface will be deprecated and likely removed in RAP 3. Therefore, I wouldn't recommend this approach.

Community
  • 1
  • 1
ralfstx
  • 3,893
  • 2
  • 25
  • 41
  • Thank you for the answer. How can i set this servlet filter to intercept any communication between client and server? – nap.gab Dec 13 '13 at 13:30
  • If you're using RWT standalone, you can configure the servlet filter in your web.xml. If OSGi, please see [this thread](http://www.eclipse.org/forums/index.php/t/627876/). – ralfstx Dec 13 '13 at 21:39