dcsimg
Applet - HttpSession
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Chetana_Srinivas
Posted On:   Tuesday, July 16, 2002 05:53 PM

Flow of my application is,Applet is embbedded in a JSP and the Applet calls a Servlet using urlConnection. I would like the session in the JSP to be passed to the Servlet. Below is my code in applet, URL url = new URL(urlName); System.out.println("URL" + urlName ); HttpURLConnection urlconn = (HttpURLConnection)url.openConnection(); urlconn.setRequestMethod("POST"); System.out.println( "Session ID"+ sessionID); urlconn.setRequestProperty("cookie", sessionID ); urlconn.setDoOutput(true); urlconn.setDoInput(true); urlconn.setUseCaches(true); urlconn.setDefaultUseCaches(true); urlconn.setRequestProperty("Content-Type",&   More>>

Flow of my application is,Applet is embbedded in a JSP and the Applet calls a Servlet using urlConnection. I would like the session in the JSP to be passed to the Servlet.

Below is my code in applet,
URL url = new URL(urlName);
System.out.println("URL" + urlName );
HttpURLConnection urlconn = (HttpURLConnection)url.openConnection();
urlconn.setRequestMethod("POST");
System.out.println( "Session ID"+ sessionID);
urlconn.setRequestProperty("cookie", sessionID );
urlconn.setDoOutput(true);
urlconn.setDoInput(true);
urlconn.setUseCaches(true);
urlconn.setDefaultUseCaches(true);
urlconn.setRequestProperty("Content-Type","application/octet-stream");

ObjectOutputStream output = new ObjectOutputStream(urlconn.getOutputStream());
output.writeObject("Test");
output.flush();
output.close();

ObjectInputStream in = new ObjectInputStream ( urlconn.getInputStream() );

   <<Less
About | Sitemap | Contact