• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

send session from applet to servlet

 
Sean McGarvey
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a web application that uses applets and servlets. When I use getAppletContext().showDocument() to send a url to my servlet, the servlet cannot retireve the session information using session.getAttribute(). In fact, request.getSession(false) returns null.

This seems to be working properly on IIS, but when I try to configure Apache, it fails unless the client is running on the server.

Any ideas would be greatly appreciated.

Thank you,
Sean
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did it by passing the session id in as an applet parameter from the jsp:plugin page.

JSP:


Applet:


In the class that the applet uses to make the HTTP Post:

[ June 15, 2005: Message edited by: Ben Souther ]
 
Sean McGarvey
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben,

Thank you for the suggestion. I believe that I am already doing exactly what you suggested though.

I did notice that when I try to access the web application running the client through IE directly on the web server, everything works fine. However, when I try to access from another host, I am getting an IE privacy report stating that the cookie was blocked. Also, I notice that the parameter "jsessionid=###" is in the url query. I have tried this from different hosts and am sure that the privacy settings on each host are setup to allow all cookies.

I think that my problem must have something to do with how I have setup Apache and JBoss on my web server. Are you aware of any server settings that I might need to modify?

Thank you,
Sean
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my code, I'm not using the cookie stored in the browser. I'm setting an applet init param with the value of the session ID. I then manually add the jsessionid to the request headers when I post from the applet to the servlet.

I am not aware of any Apache or JBoss settings.
Do you have cookies disabled in your browser?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic