File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
jQuery in Action, 3rd edition