aspose file tools*
The moose likes Applets and the fly likes Remembering username and password in an unsigned applet... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Remembering username and password in an unsigned applet..." Watch "Remembering username and password in an unsigned applet..." New topic
Author

Remembering username and password in an unsigned applet...

James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
Does anyone have any ideas how my unsigned applet could remember the username and password entered by a user?

Previously, I was using a signed applet so could store the username and password in a persistent text file, but now I need to provide an unsigned applet solution - so does anyone have any suggestions for how my applet could remember and recall the username and password?

Many thanks,
James
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Java 1.4 introduced a way for applets to store information. Check out the AppletContext.setStream, getStream and getStreamKeys methods.


Ping & DNS - my free Android networking tools app
James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
Thanks for the reply. Unfortunately, I'm in Java 1.1. Any other ideas?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
If that means that you're using the age-old MS JVM in IE, you might be lucky. It does a good job of interfacing applets with JavaScript via LiveConnect, and JavaScript can set and retrieve cookies (which in turn can contain the preferences).

Googling for "cookie.js" will find any number of JS cookie libraries.

Some links about LiveConnect are in the Applets FAQ.
James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Remembering username and password in an unsigned applet...