-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Antonio,
On 3/4/2010 10:58 AM, PAROLINI Antonio wrote: > We are using a custom valve that scan the request parameters (POST > AND GET) . If it find a parameter called "secuId" with a valide value > , it set the session principals ( a kind of SSO).When this work most > of the times, we have somes cases where calling the > HttpServletRequest .getParameter() method within a valve has an > impact to the called servlet. It does: calling request.getParameter will consume the request body if the following are true: 1. The protocol is HTTP or HTTPS 2. The method is POST 3. The Content-Type is application/x-www-form-urlencoded [4. A call to request.getParameter*, which you're already doing] > Those cases are a "java.io.IOException: Connection reset by peer: > Amount read didn't match content-length " for the WebObject servlet, > and a EOFException in the invoker servlet in Jboss). That seems fairly straightforward: the client is sending a Content-Length that doesn't match the amount of data sent: too few bytes or too many. Can you post the whole stack trace? > So if I cannot use HttpServletRequest .getParameter() in my valve, > what other option do i have? Well, if the Content-Length is wrong, you're going to have problems no matter what. If request.getParameter* fails, I don't think that any other APIs are going to help you... > I've see that there is a request.getCoyoteRequest().getParameter() > methode in the low level Tomcat API. Is this an option ? I suspect you'll get the same exception from this level of code, too (I'll even bet that method one calls the other). If you must, I suppose you could read the request body yourself and simply ignore the Content-Length mismatch. Honestly, I would try to figure out why the Content-Type isn't matching the request body length: this is likely to be a problem with whatever client you are using. It's possible that it's an encoding mismatch. Content-Length is supposed to mean number of octets, but it's possible that your client is reporting the number of characters being sent, which would probably be less than the number of bytes (though you get an EOFException, so I'm guessing that the Content-Length is /larger/ than the body you receive). Strange. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkuP4q0ACgkQ9CaO5/Lv0PBrFwCgg9b2UUemCnMhpncsq3y17UZs H7EAn0YzqpXr907l4rzTXMV3A3SLpm+b =eddn -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org