Yann Durand wrote:
>
> Does anyone have some examples of communication between applet and servlets
> ?
>
> For example, a servlet gets a integer variable from an applet, invokes a
> method (with applet variable passed in argument) which products a result,
> and send this result to the applet.

You can't really invoke a method on the servlet, unless your servlet is a remote
server (RMI), CORBA server, or EJB. And if it is one of those, it doesn't need
to be a servlet.

What you can do is send text or objects between an applet and a servlet using an
HTTP connection or a socket connection.

Karl Moss's book has just such an example. The book web site is
http://www.servletguru.com/. If you go to the downloads section, you can get all
the code from the book. Unfortunately, without the book, you may have trouble
figuring which examples to look at. Unfortunately, I don't have my copy handy,
either. I think DataStreamEcho.java is the servlet you need, TestDataStream.java
is the client. Also look at the other examples in the \javaservlets\tunnel
directory.

Jason Hunters book also has information on applet-servlet communication. It's
chapter 10 (first edition). Code can be downloaded from http://www.servlets.com.
Examples 1 - 10 should help.

JGuru FAQ entry: http://www.jguru.com/jguru/faq/view.jsp?EID=157. Follow the
links in the FAQ entry to jnine and netscape.

Also, since this question comes up about once a month, check the mailing list
archives.

K Mukhar

___________________________________________________________________________
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