You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "phil@enappsys.com" <ph...@enappsys.com> on 2004/06/18 22:41:54 UTC

Reading the servlet input stream twice

Dear All,

I use Tomcat 4.1.xx
I am implementing page tracking on a project.
I am coming across a problem, when I want to write a copy of the parameters
or contents of a POST request to the database.
I have tried using HttpServletRequest.getInputStream () but this cleans out
the input stream and means that no parameters
or content is available to be passed on to the logic that processes the
parameters or post content.

Is there anyway of getting a copy of a POST request content without
cleaning out the input stream and stuffing up the suceeding logic?

Regards,

Phil Hewitt

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Reading the servlet input stream twice

Posted by QM <qm...@brandxdev.net>.
On Fri, Jun 18, 2004 at 04:41:54PM -0400, phil@enappsys.com wrote:
: I am implementing page tracking on a project.
: I am coming across a problem, when I want to write a copy of the parameters
: or contents of a POST request to the database.
:  [snip]
: Is there anyway of getting a copy of a POST request content without
: cleaning out the input stream and stuffing up the suceeding logic?

Servlet Filter, maybe?
Aren't both POST and GET params available via request.getParameter()
or am I not correct?

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Reading the servlet input stream twice

Posted by Justin Ruthenbeck <ju...@nextengine.com>.
The cleanest, most standards-compliant way of doing what you're asking is 
through the HttpServletRequestWrapper.

Make sure you've duely considered QM's comments about the getParameter() 
methods.

justin


At 01:41 PM 6/18/2004, you wrote:
>Dear All,
>
>I use Tomcat 4.1.xx
>I am implementing page tracking on a project.
>I am coming across a problem, when I want to write a copy of the 
>parameters
>or contents of a POST request to the database.
>I have tried using HttpServletRequest.getInputStream () but this cleans 
>out
>the input stream and means that no parameters
>or content is available to be passed on to the logic that processes the
>parameters or post content.
>
>Is there anyway of getting a copy of a POST request content without
>cleaning out the input stream and stuffing up the suceeding logic?
>
>Regards,
>
>Phil Hewitt
>
>--------------------------------------------------------------------
>mail2web - Check your email from the web at
>http://mail2web.com/ .
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


______________________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential. See:
http://www.nextengine.com/confidentiality.php
______________________________________________


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org