Hi list,

I am facing the following problem in passing parameters between servlets:

Servlet A logs the user in and returns the user's name from the DB (this works
fine)

I then call an applet (MyApplet)which in turn establishes a connection with Servlet B.

What I want, is for B to get the data returned by A and pass that data
to the MyApplet for nice representation to the user.

B connects to MyApplet fine as follows


 try
 {
   URL url = new URL(getCodeBase(),       
"http://MyServer:8080/servlet/Pachage.ServletB");

   connection = url.openConnection();
   connection.setDoInput(true);
   connection.setRequestProperty("Content-Type", "application/octet-  stream");
   HttpMessage msg  = new HttpMessage(url);
   Properties props = new Properties();
   props.put("format","object");
   InputStream in = msg.sendGetMessage(props);
   ObjectInputStream oin = new ObjectInputStream(in);
   String name  = (String)oin.readObject();
   System.err.println("name retrieved successfully!!...");
   oin.close();
  }
  catch{ etc....}

  return name;// This is where I am going wrong A does not seem to pass   //the right 
value to servlet B.

Can I do that using a session object in A and return its values in B??

Basically I would like A to do most of the communications with the database and B to 
just simply return data to My Applet as serialized objects.

Any suggestions would be appreciated.

Thanks

Tarek Shaar.

___________________________________________________________________________
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