Of course that it’s not going to work, because the client can’t call to piwik’s files (piwik.php).
Piwik server will be only in localhost. and I must call it from a servlet, so client can’t call directly piwik server, he must transit by my webapplication wich is in J2EE.
Perhaps the (currently under development) Piwik Tracker Java port would be a solution in your case: Java Tracking Client V1 - PiwikTracker.java · Issue #2172 · matomo-org/matomo · GitHub
So tracking could completely be handled on the backend side and there would be no need to directly contact the piwik installation from client machines. Or did I miss something?