Solved

Java Applet - File Output possibilities?

Posted on 2003-10-23
4
373 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

705 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