Win a copy of The Career Toolkit this week in the Jobs Discussion forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

send session from applet to servlet

 
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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • 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 VI Editor Redhat
  • 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?
 
A wop bop a lu bop a womp bam boom! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic