Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Applets and the fly likes Jsessionid JSP and applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Jsessionid JSP and applet" Watch "Jsessionid JSP and applet" New topic

Jsessionid JSP and applet

Raymond Champion

Joined: Jan 21, 2009
Posts: 13
Hello friends,

I have an application that uses jsp with JFileUpload applet. How do I maintain the JSESSIONID created when the application first requests from the server? When the applet is run, a different JSESSIONID is created and used for uploading the files. I am setting a session attribute of the username before invoking the applet. After the applet gets invoked, the previous session is no longer available to the applet and therefore the session attribute I need is no longer available.

Code snippet from the jsp(fileupload.jsp) calling the javascript to invoke the applet.

The following is the applet_http.js

The following process.jsp

I think my question is can I make the JSESSIONID from the intitial session creation available to the applet, and therefore the session, instead of the applet getting another JSESSIONID from the server?

I don't have access to the JFileUPload source code, so I can't modify that, unless I purchase the Premium edition for $499.00.

Thanks for any insight into this issue.

Raymond Champion

Joined: Jan 21, 2009
Posts: 13
Let me try to be more clear. I am creating a session variable of username when user logs in. I am using the JSESSIONID that is sent from the server when the user firsts logs in. When I get to the jsp with the JFileUPload applet in it, the applet gets another JSESSIONID from the server and the previous session varaible is no longer available and I need it to create a specific directory to store the uploaded files.

Any ideas???
I agree. Here's the link:
subject: Jsessionid JSP and applet
It's not a secret anymore!