Robbie Baldock wrote:

> Nathan Meyers wrote:
>
> > No, this won't work.
>
> I didn't think it would!
>
> > Environment variables are associated with Unix processes and passed to
> > child processes. You can't really set one "just for the servlet", you need
> > to set it for the Unix process under which the servlet is running -
> > meaning the JVM.
>
> But isn't this a bit crap?  I mean, does this mean that all java
> processes running on a Linux box (whether they be servlets or
> applications) have to share the same DISPLAY settings?!

As someone else noted, only the java apps running within a single instance of
the JVM will be affected.  When the web server that supports servlets is
started, it starts a JVM for the servlets.  Thus, only servlets started from
that web server will run within that JVM.

One solution you might use to get around any unusual servlet issues is to have
your servlet use RMI to connect to separate application running under a
different JVM.  At my company, we have used a similar approach with servlets,
albeit for a far different problem (no java2d).  We use the session ID from the
servlet as the RMI lookup name, thus providing persistance for the client
(servlets are stateless, and die after the servlet manufactures the response).
When the servlet first attempts to connect to the "server" process via RMI, the
connection fails (the server has not yet been started).  When this happens, we
launch the server process from the servlet, passing the RMI lookup name as one
of the arguments.  Subsequent connections can connect to the server process
using this RMI lookup name.

I hope this helps...

-dan


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to