title: How I can add parameter to request from jersey filter request (ContainerRequestFilter)
body: <p>I am use Jersey + Spring. I have Jersey filter which implements ContainerRequestFilter, and i need transfer object in my jersey resource. </p>
  
  <p>For example:</p>
  
  <pre><code>@Provider
  
  public class UnmarshalEntityFilter implements ContainerRequestFilter {
  
  private static final Logger LOGGER = LoggerFactory.getLogger(UnmarshalEntityFilter.class);
  
  @Override
  public ContainerRequest filter(ContainerRequest containerRequest) {
  
      final String xml = getRequestBody(containerRequest);
      // Parse this xml to Object
  
      // How I can add this Object to my request and get from Jersey Resource ?
  
      return containerRequest;
  }
  
  private String getRequestBody(ContainerRequest request) {
  
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      InputStream in = request.getEntityInputStream();
      StringBuilder sb = new StringBuilder();
      try {
          if (in.available() &gt; 0) {
              ReaderWriter.writeTo(in, out);
  
              byte[] requestEntity = out.toByteArray();
              sb.append(new String(requestEntity, "UTF-8"));
          }
  
          return sb.toString();
      } catch (IOException ex) {
          throw new ContainerException(ex);
      }
  
  }
  </code></pre>
  
  <p>}</p>