On Tue, 11 Jan 2000, Kevin Jones wrote:

> The servlet can't send a command to an applet. However you could have the
> applet send a request to the servlet. Check out the archives for (many)
> discussions of URL and URLConnection objects,
>
> Kevin Jones
> DevelopMentor

This is not strictly true. It rather depends on what you term a 'command'.
Since the servlet can send back just about anything to an applet (through
serialised objects) the applet can parse the response and start jumping up
and down.

Consulting relevant literature for applet-servlet communication (e.g. the
chapter from Jason Hunter's book) I have implemented the following
scenario:

-a framed applet dispatches a query string to a servlet

-the (multithreaded) servlet executes some complicated algorithm informing
the user for its progress by dispatching serialised objects that turn to
'Server messages' on an appropriate applet TextField.

-once the servlet finishes, the applet redraws its own interface according
to results with any AWT components that make sense, presents some relevant
results in a TextArea and a separate HTML page is sent to the browser.

I think the above proves the point, that you CAN indeed send commands to
an applet with pure Java (1.1 in fact), with a lot of trouble though.

For the original poster: If you need the applet to be embedded, pop up a
new browser window for your HTML results.

Hope this helps,
Kostas

___________________________________________________________________________
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