Solved

Java Applet - File Output possibilities?

Posted on 2003-10-23
4
364 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

770 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