On 09.12.2015 14:03, Roel Storms wrote:
The real requirement is being able to process the body of a request in a
Valve without restricting the servlet to call request.getInputStream,
getReader and getStream. I have tried by wrapping the request but some
behavior can't be masked. It is also much more simple to implement by just
extending the Request class and using this in Connector.createRequest().
So the actual requirement is a Valve wanting to process the body but still
allowing the target application to call whatever processing method they
chose. When the Valve would chose to process the body by calling
Request.getInputStream(). The servlet wouldn't be able to call getReader or
getParam anymore. I would like my Valve to be transparent in that sense.
I am no java nor Tomcat guru, so take this with caution :
Looking at
http://tomcat.apache.org/tomcat-8.0-doc/config/http.html#Common_Attributes
--> maxSavePostSize
makes me think that there is a case where tomcat saves an incoming request body, and
restores it afterward (after the authentication). Since the authentication takes place
before the webapp is called, it cannot know the way in which the webapp is going to
consume the request body. So the saved body must be saved in such a way, that the webapp
can afterward consume it in the way it chooses.
Doesn't that provide some clue on how to solve your problem ?
2015-12-09 13:07 GMT+01:00 Konstantin Kolinko <knst.koli...@gmail.com>:
2015-12-09 14:13 GMT+03:00 Roel Storms <roel.sto...@gmail.com>:
Hello,
In Tomcat 4.1 it used to be possible to specify a custom class for the
Connector: https://tomcat.apache.org/tomcat-4.1-doc/config/coyote.html
In the newest versions it's only possible to provide a custom Protocol.
However I would like to modify the Request that is created by the
Connector.createRequest() method. Is this no longer possible via
configuration?
As a note:
If such a feature ever going to be implemented, the place to fix is
org.apache.catalina.startup.ConnectorCreateRule class.
Instances of Connector are created via that rule, instead of a
standard class creation rule, and so (unlike other elements processed
by digester) className attribute does not work here.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org