wood burning stoves 2.0*
The moose likes Servlets and the fly likes Applet-servlet commn Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Applet-servlet commn" Watch "Applet-servlet commn" New topic

Applet-servlet commn

yashendra chandrakar

Joined: Mar 22, 2002
Posts: 22
I am using applet as frontend to servlet.
servlet get some data from database,and send it to applet as follows:
//in servlet
ObjectOutputStream out =
new ObjectOutputStream(res.getOutputStream());

result is a Serializable object of type suppose BDResult,which contain all the information from ResultSet.I m writing it usint writeObject()as i can't send ResultSet, as it is not serializable.
received in applet as follows:
//in applet
ObjectInputStream in=newObjectInputStream (urlConnection.getInputStream());
BResults results=(DBResults)in.readObjec);
i put the applet & servlet class in SERVER_CLASSES & SERVLET_CLASSES respectively of my weblogic server.
now where should i keep DBResult class file,so that both servlet and applet could be compiled.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12675
Due to the way applet and servlet load classes, you need two copies, one where the the other applet classes are kept and one where the servlet classes are kept.

Java Resources at www.wbrogden.com
I agree. Here's the link: http://aspose.com/file-tools
subject: Applet-servlet commn
Similar Threads
applet servlet communication
send socket from applet to servlet
sending two byte arrays from servlet to applet
Applet and Struts
Applet in J2EE application