> Just curious to know if there is a way to have a servlet that is not
> destroyed at the end of it's request?
A normal servlet is not destroyed at end of request. It is
one object being used by multiple threads.
If you implement SingleThreadModel then you get the behaviour you
describe.
> Also, is there any way I can get a reference to an instance of a
> servlet from somewhere else on the same application server?
>
> (Assuming Sun App Server 9.0)
You don't. You redesign so you do not need it.
(if you really want to then I think you can have
the servlet itself save this somewhere where you can get it)
Arne
Hi There,
AFAIK, a servlet does not get destroyed at the end of a request. The
container re-uses a servlet instance (1 and only 1, unless you're
refering to the SingleThreadModel) to "service" the requests in
multiple threads. Could you elaborate on what you are trying to
achieve, and possibly, why you need something like this. Also, since
the container manages the lifecycle of a servlet, you should avoid
situations where you want to get a hold of a servlet instance and
invoke its methods.
-cheers,
Manish
> Just curious to know if there is a way to have a servlet that is not
> destroyed at the end of it's request?
[quoted text clipped - 3 lines]
>
> (Assuming Sun App Server 9.0)
atrauzzi@gmail.com - 23 Sep 2006 16:43 GMT
These are all good explanations towards all my questions. Thank you.
I just want to have something running server-side that watches and acts
upon messages on a topic via JMS.
On that note, do any of you know of some DECENT JMS tutorials? Front
to back? Even sun's "Java EE 5 Tutorial" does a spotty job on
explaining how one can make a JMS application. All the examples seem
to omit something.
I know exactly how I want to structure this, I just have a difficult
time pulling out the correct understanding of all the seemingly
appropriate Java components to get the job done :D
Thanks again!
- Alex
> Hi There,
>
[quoted text clipped - 17 lines]
> >
> > (Assuming Sun App Server 9.0)