title: How can I peek into a Mesage from a Filter?
body: <p>I tried to use a <code>javax.servlet.Filter</code> to peek into a message.</p>
  
  <pre><code>public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
       BufferedReader reader = request.getReader();
       if ( reader.markSupported() ) {
           reader.mark( contentLen );
       }
       String content = reader.readLine();
  
       // search some pattern
  
       if ( reader.markSupported() ) {
           reader.reset();
       }
       chain.doFilter( request, response );
  }
  </code></pre>
  
  <p>The servlet that finally receives the request throws this exeption:</p>
  
  <pre><code>java.lang.IllegalStateException: getReader() has already been called for this request
  </code></pre>
  
  <p>Which is correct behaviour according to the javadoc.</p>
  
  <p>My questions is how can I read the content of the input-stream anyway?</p>
  
  <p>I also tried <code>ServletInputStream is = request.getInputStream();</code></p>