It does not matter that the client and server are running on the same machine.
If you think carefully about the role of servlets, it should be clear why
trying to construct a graphics context from a servlet is an inherently
meaningless operation.
The *client* (if running in a browser) may be able to ask this question,
and relay the answer to the servlet, but even this is not guaranteed.
I would suggest that you pick up a good book on servlets, and do some reading.
From: Liang, Li (MED)
> Thanks, Preston! But I have client and server running on the same
> machine.
>> Ask yourself where your servlet is running with respect to the screen.
>> Servlets run on a server, and has no knowledge of the client's screen.
> >> I got a problem when I use a servlet to to get the screen resolution by
> >> calling a class that uses getToolkit() to get default system awt
> >> toolkit. Java 1.2.1 and servlet 2.1 are used. Below is a stack trace:
___________________________________________________________________________
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