Solved

Java Applet - File Output possibilities?

Posted on 2003-10-23
4
367 Views
Last Modified: 2010-03-31
I have a Java Applet program I wrote to run a psychology experiement. It displays a series of words and records response time from the user.  I'd like to have it output results to a textfile(continuosly adding to end of file).  Is there anyway possible to have a java applet running locally output to a file?  I've tried modifying the security permissions in the browser, but still can't get it to work!  If this isn't possible... any suggestions?

Thanks,
Chris
0
Comment
Question by:cmreichl
  • 2
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 125 total points
ID: 9608015
0
 

Expert Comment

by:bjornsone
ID: 9610083
Yes it's possible, but it's not worth the hassle.

The applet does not by default have sufficient security privileges, so you
need to assert the proper authority.  The method of doing this is not consistent
between all browser (netscape, Microsft Internet Explorer, and Sun's java plugin).
I can give you code snippets I found and have used for the first
two browsers, but I haven't yet worked with Sun's plugin.

Furthermore, I know that netscape and Internet Explorer require
you to sign your code with a digital certificate before it will allow
your code to get outside of the java sandbox.  I got a code signing
certificate from the security company Thawte (cost and lots of hassle)
in order to get our java code to work with the file system.

0
 

Expert Comment

by:bjornsone
ID: 9610153
The java applet does have permission to make http requests
to the server from which it was downloaded.  You could have
the applet give the information to the server using the HTTP
request, and the server could keep track of the data using the
local file system or a database.  The user could then have an
option to view or download the file from the server using a link
from within their web browser.
The server could use a servlet to generate the content to be
downloaded by using either the file or a database query.

The server would need to identify different users in order to
let each person download his/her own data.  Cookies could
be used for this purpose.

This system would work, but it would not be trivial to implement
if you are not experienced.  

I hope somebody else can find an easier work-around for the
java security restrictions on the applet.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9627559
:-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Desingning Refactoring existing code 2 31
printf performancy 11 83
running on tomcat not jboss eap 7.0 3 28
Java 8 to Java 6 8 32
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question