Hi there!
1) Can we please have subjects for easy reading / archiving purposes?
2) I have seen this line of argumentation a couple of times and I have not
been convinced that there is any validity in the interpretation of the
following statement:
> I would not do so - A servlet is meant for processing a request and send
> a response. That's the only specified behavior that the container
> expects from a servlet.
"Processing a request" is such a generic term that allows just about
everything to happen. Assuming I contact my home web server and run a
servlet that has to turn on the water-heater through JNI (sorry no JINI
compliant water-heater, yet!), query an inventory database on whether
ingredients exist for my favourite recipe that I pass as a parameter and
SMS to my wife through an SMS modem (sorry, WAP has no push yet:-) that I
am coming home early and I am cooking. Would you do all that in a single
thread?
The idea that servlets are HTML-producing chunks of code was a bit of an
underestimate in the start and nowadays with all these alternative ways to
produce dynamic HTML it should be quite obsolete. The fact that we still
ride on top of HTTP, and primarily use servlets as glorified CGIs to query
databases is another long discussion.
Additionally, "manipulating" the context space if done according to specs
and the methods that are allowed in the implementation, and of course,
under valid OOP techniques (e.g. 'grounding' on local copies) would not be
a problem. Putting these resources back when the spec allows you to do so
with setters is also acceptable.
Therefore, feel free to use all the Java techniques that you are aware of,
should they fit your purpose and do not bend the specs. This last thing,
after all, is the container's responsibility and I am sure Sun would like
to hear of people pushing to the limits.
Above all, I think it is time to 'decouple' servlets from HTML production.
Maybe we should just keep it as a spin-off or side-effect.
Kostas
> I'm not going to disprove about your applications working or not. It all
> depends on what resources you're using during these threads. As long as
> you don't use any resources maintained by the container
> (request/response objects, session objects, context etc.), you're safe.
> This is because, all these resources are not guaranteed to be available
> outside the context of a request. Things might still work - but you can
> not guarantee in a production environment.
>
> Keeping the original intent of servlets in mind- I would not implement
> such things. The rest is a matter of choice.
>
> Just on the lighter side - I've heard of a story where a team struggled
> to figure out why their app server (hosting servlets) is crashing. They
> could not find any clue from the server logs. Finally, they figured out
> that some of the servlets have System.exit() statements during exception
> handling! What do we conclude from this?
>
> Cheers.
>
___________________________________________________________________________
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