1

Is there an implementation or a way to specify InputStream instead of just a path to a resource when pushing using Servlet 4.0 PushBuilder? I need to push chunks of data and so far I have not found a way to push the data without creating a resource file first.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Novotmike
  • 47
  • 3

1 Answers1

1

Just create another servlet which writes the desired InputStream to the response, if necessary depending on some query or path parameter, and specify its URL in the resource list.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Example of how such a servlet would look like: https://stackoverflow.com/q/10564594 – BalusC Feb 14 '18 at 12:03
  • I understand what you mean - but I still have to figure out how to implement this so that the "data resource" would be called just once not multiple times. I'm looking to sending just data - and these data need to be chunked after they are retrieved. I'm not looking at exactly replacing multiple "offset-limit" calls but rather one request multiple responses. – Novotmike Feb 14 '18 at 12:04