Hi All,
Does anyone know how to maintain a session (so I can store
objects in the session object) whwn servlet's client is
another servlet on another web site. The client servlet uses
the code below to post a Java object as a request.
The response comes back as a response java object
The code below works OK. I just need to add
maintenance of sessions.
I use Apache/Jserv. How I send back the information about
the current session. I guess the client server needs to
retreive/save and send back the JservSessionId cookie.
Any suggestion will be apprecated.
Happy Thanksgiving to folks in the US.
Dragomir
public AuthResponse authorize(
Serializable req )
throws IOException, ClassNotFoundException
{
URLConnection con = authURL.openConnection();
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
con.setRequestProperty(
"Content-Type",
"java-internal/" + req.getClass().getName());
ObjectOutputStream out = new ObjectOutputStream(con.getOutputStream());
out.writeObject(req);
out.flush();
out.close();
InputStream in = con.getInputStream();
ObjectInputStream r = new ObjectInputStream(in);
return (AuthResponse)r.readObject();
}
___________________________________________________________________________
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