Paul Copeland <[EMAIL PROTECTED]> writes: > So your example boils down to a proposal to close the Response output > stream before the servlet service() routine returns.
It's not a proposal. It's an example of an alternative to using JMS. And it's a perfectly valid example of how to do batching inside a container. It is also an illustration of the logic flow for more complex systems, you could create a thread to process the job, or spawn another process. Maybe the call to the stored proc in my example is doing some message queueing of it's own. The point is that the pattern is always the same. > It may be this only works if there is no ServletResponseWrapper that > might have modified the response stream. Certainly anthing hooking onto the post execution of the service won't run till the method completes (which it will eventually). This is a feature, not a bug. Any filter altering the content output will still work. Study the way filters are done and you should see that. > Some webserver-servlet container configurations may not actually > close the HTTP response until the service routine returns. Software can always be incorrectly implemented. But the requirement is to close the response if the content length is written. Sending HTML in the way I did should cause that to happen. > Again I haven't tested this, but the technique relies on the > Response output stream being connected to the HTTP response stream. Err... yes. It does. It is. > If you need scalability you may still want a design that uses JMS or > a message driven bean to offload the processing from the servlet > container. I think this is a meaningless statement. What do you mean scalability? JMS is not a blanket solution. It's one possibility, yes. In short, I believe that you're making the quite common Java is Enterprise Java mistake. -- Nic Ferrier http://www.tapsellferrier.co.uk ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html