10

I'm using the Java Preferences API to store and retrieve small pieces of information in a swing/java application.

Now i have setup Java Web start to launch the application from my web page, and I get a security exception. In order to get rid of this exception, I'd have to prompt the user for permissions. And I refuse to do that because my application does nothing else that would require the user's permission.

That's why I need an alternative solution for storing a few key values from one execution to another. Some sort of cookie or whatever. Do you know any please ?

Maurício Linhares
  • 39,901
  • 14
  • 121
  • 158
Joel
  • 3,427
  • 5
  • 38
  • 60
  • it is quite unreasonable that app can't save moderate amount of client data on client machine. you probably have to sign your app. – irreputable Jul 30 '11 at 22:23

1 Answers1

12

You may want to look into using PersistenceService, a feature of Java Web Start that "provides methods for storing data locally on the client system, even for applications that are running in the restricted execution environment." Related examples may be found here and here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • @Andrew Thompson, the author of the [example](http://pscode.org/jws/api.html#ps), may be able to offer additional guidance. – trashgod Jul 31 '11 at 00:07
  • It's exactly what I needed and the example you pointed is very clear. Thanks a lot. – Joel Jul 31 '11 at 02:05