Solved

Java Applet - File Output possibilities?

Posted on 2003-10-23
4
358 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
Comment Utility
0
 

Expert Comment

by:bjornsone
Comment Utility
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
Comment Utility
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
Comment Utility
:-)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
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…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now