Results 1 to 1 of 1
- 07-15-2011, 08:53 AM #1
Member
- Join Date
- Jul 2011
- Posts
- 1
- Rep Power
- 0
Applet Servlet :HTTPOnlyCookies issue
Hi All,
I am facing a problem while tring to make a communication between applet and servlet with HttpOlyCookie enabled.
Communication between applet -servlet work's fine when the HttpOnlyCookie property is disabled.
However when the property is enabled the communication between the two breaks.
The problem which is happening is that when the applet send a request the server creates a new session each time due to which a session does not get established between the two.
WebsphereApplicationServer : 6.1
Applet Code (ClientSide):
URL url = new URL(servletURL);
HttpURLConnection httpConn = (HttpURLConnection)url.openConnection();
httpConn.setDoInput (true);
httpConn.setDoOutput (true);
httpConn.setRequestProperty("Cookie", "JSESSIONID="+sessionId);
httpConn.setUseCaches (true);
ObjectInputStream ois= new ObjectInputStream (httpConn.getInputStream ()); //ObjectInputStream object is not getting created and the code throws exception at //this point.
Object obj=ois.readObject();
ServerSide:
ServletOutputStream out = null;
ObjectOutputStream oos = null;
Map map=new HashMap();
map.put("key", "tested");
out = response.getOutputStream();
oos = new ObjectOutputStream(out);
response.setContentType("application/octet-stream");
oos.writeObject(map);
Exception :
java.io.StreamCorruptedException: invalid stream header: 0D0A0D0A
Similar Threads
-
servlet issue
By tjhodge in forum New To JavaReplies: 7Last Post: 05-20-2010, 11:55 AM -
Performance issue - How to Queue and process Servlet Requests
By gemgb in forum Java ServletReplies: 1Last Post: 09-27-2009, 03:36 AM -
Applet Mac issue
By omdom in forum Java AppletsReplies: 1Last Post: 08-23-2009, 07:54 PM -
Memory issue in servlet application in a tomcat container
By bedhinesh in forum Java ServletReplies: 2Last Post: 07-24-2009, 01:26 PM -
Java Applet Issue
By bmw4l1f3 in forum New To JavaReplies: 9Last Post: 11-13-2008, 04:39 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks