Piwik with Java Servlet



I’m working with Piwik to track my J2EE application.
I’m trying to track a downloading of a document via servlet.
So in java, in my servlet, I get the document id I use in my url then I get the document in my DB and I copy this document via InputStream in the HttpServletResponse resp.
When I used this in a html that works properly but Piwik doens’t seem take care of it.

Could you please help me ?

Thank you