Paul Copeland <[EMAIL PROTECTED]> writes:

> Nic - Thanks for your information on this. Sorry I called your example a 
> proposal.
> 
> FYI - the Servlet API is part of Enterprise Java, not core Java. But I 
> certainly don't find the distinction between Enterprise and Core Java to 
> be very meaningful either way.

FYI I was one of the expert team for servlet 2.3 and 2.4. I
contributed the initial design of the filter API. I resigned from the
team because of Sun's pollution of the spec process with marketing
issues so I know where Servlets are placed in the marketing pantheon.

The point about servlets and enterprise java is that servlets are
often found stand alone, without an EJB or JMS container. Since
EJB/JMX can be expensive it should not be necessary to use them for
simple things like that being discussed.


> Below is text from the Servlet 2.4 spec. It appears that if you had 
> called setContentLength that would have made your example work in the 
> way you intended.

This is the salient point from 2.4:

> â The amount of content specified in the setContentLength method of the 
> response has been written to the response.

When you use the response Writer you'll find that content length is
set automatically (with most container implementations) for small
content.



> The scalability point I made is that in high volume websites it is 
> considered best-practice (in many books and patterns on the subject) to 
> not execute transaction processing inline in the servlet service thread. 
> In addition to reducing the load on the servlet container, this kind of 
> modularization (via EJB, RMI, JMS, etc.) provides flexibility in 
> distributing the application. The technique in your example is perfectly 
> adequate for performance in many cases of course.

And the point I was making is that this advice is almost
meaningless. We tell newbies that spawning threads in servlets is, in
general, a bad idea. But that doesn't mean it's always a bad idea.

There is *nothing* wrong in *principal* with using the container
thread to do work after the response has been sent.


-- 
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

Reply via email to