You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Garth Patil <ga...@gmail.com> on 2005/03/22 02:43:40 UTC
post processing operations after servlet response is sent
Hi,
I've got some operations I'd like to do (transaction logging and some
web service calls) after the servlet response is sent to the user.
Rather than creating a new thread every time, is there a way to do
this in my servlet so that it uses tomcat's processor thread, but is
executed after the response is sent?
Thanks,
Garth
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: post processing operations after servlet response is sent
Posted by Dov Rosenberg <do...@conviveon.com>.
Why don't you create a filter? They are designed to interact with the
request/response loop either before the servlet is kicked off or after the
servlet gets called.
HTH
--
Dov Rosenberg
Conviveon Corporation
http://www.conviveon.com
On 3/21/05 10:13 PM, "QM" <qm...@brandxdev.net> wrote:
> On Mon, Mar 21, 2005 at 05:43:40PM -0800, Garth Patil wrote:
> : I've got some operations I'd like to do (transaction logging and some
> : web service calls) after the servlet response is sent to the user.
> : Rather than creating a new thread every time, is there a way to do
> : this in my servlet so that it uses tomcat's processor thread, but is
> : executed after the response is sent?
>
> Why not offset the extra processing (the logging and ws calls) to
> another system? You could package up the needed info and either put it
> in:
>
> 1/ a database to be processed by a scheduled job
> (in-container or external)
>
> 2/ a JMS message, to be handled by a dedicated listener
> (again, in-container or otherwise)
>
> These solutions have the added benefits of not being tied to your
> servlet code. (Think "modularity" and "ease of testing," among other
> things.)
>
> -QM
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: post processing operations after servlet response is sent
Posted by QM <qm...@brandxdev.net>.
On Mon, Mar 21, 2005 at 05:43:40PM -0800, Garth Patil wrote:
: I've got some operations I'd like to do (transaction logging and some
: web service calls) after the servlet response is sent to the user.
: Rather than creating a new thread every time, is there a way to do
: this in my servlet so that it uses tomcat's processor thread, but is
: executed after the response is sent?
Why not offset the extra processing (the logging and ws calls) to
another system? You could package up the needed info and either put it
in:
1/ a database to be processed by a scheduled job
(in-container or external)
2/ a JMS message, to be handled by a dedicated listener
(again, in-container or otherwise)
These solutions have the added benefits of not being tied to your
servlet code. (Think "modularity" and "ease of testing," among other
things.)
-QM
--
software -- http://www.brandxdev.net/
tech news -- http://www.RoarNetworX.com/
code scan -- http://www.JxRef.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org