[6366] in java-interest

home help back first fref pref prev next nref lref last post

Re: Simple File IO

daemon@ATHENA.MIT.EDU (Coby Royer)
Sat Mar 30 00:22:08 1996

Date:         Wed, 20 Mar 1996 14:27:42 -0700
Reply-To: Java Interest <JAVA-INTEREST@JAVASOFT.COM>
From: Coby Royer <croye@ENET.NET>
To: Multiple recipients of list JAVA-INTEREST
              <JAVA-INTEREST@JAVASOFT.COM>

RE the recent postings on writing data back to a server via Java applet:

The Sun on-line Java tutorial has a (growing) wealth of info that I recommend.
It is at http://java.sun.com/tutorial/intro.html and can be
downloaded as zip or UNIX compressed html or PostScript from
http://java.sun.com/tutorial/intro.html#DOWNLOADING.

See http://java.sun.com/tutorial/networking/urls/readingWriting.html in the
tutorial for a description of transmission of data from a user to a server
"through" a URL.  This appears to be the preferred approach to creating
interactive pages that send info back to the host.  I have not tested this
first hand.

Good Luck!!


>Life gets a little complicated when dealing with File I/O in a couple
>of respects:
>
>*       The I/O classes only deal with local files on the client,
>        not remote files on the server.
>
>*       Even if you wanted to use just local files in an applet, this
>        would work under the applet viewer, but not under Netscape --
>        Netscape chose to disallow local file access when running
>        applets (although it should work fine for applications).
>
>If you want to store stuff on the server instead, you might look at one of
>the following approaches:
>
>*       Use the socket connection classes (java.net.*) to establish a
>        socket link between your applet and a server program running
>        on your host.  This server program can be implemented in any
>        convenient language, as long as it can access the socket system
>        calls.  This will require you to have some knowledge of network
>        programming -- I've seen lots of books in bookstores about this,
>        but don't have a name off the top of my head to recommend.
>
>*       If your applet simulated a user filling out and submitting a
>        form, and if you had a CGI program to accept that data and do
>        whatever you wished (such as store it on the server), you might
>        be able to meet your requirements without getting down and dirty
>        on socket level programming.  You'll need to look in the Java
>        class library documentation for the classes to do this, or ask
>        on the list for some specific code samples.
>
>Also, www.gamelan.com is a good source of examples for applets -- there is
>a pretty extensive library of examples, documentation, and links to other
>online resources.
>
>
>At 09:10 PM 3/19/96 +0000, you wrote:
>>>        Hi. Does someone have an example that does simple file i/o?
>>>I just want a client to be able to read in a file, and then update it,
>>>over the network.
>>>Can you do that with a regular http server, or do you need to make a java
>>>server. I need network IO documentation!
>>>
>>>
>>
>>I have posted a couple of questions on File I/O and would be pleased to share
>>with you any replies I get and I would appreciate it if you would do the same.
>>
>>    Cheers,     Alan.
>>
>>
>
>

-----
This message has been forwarded via the JAVA-INTEREST
mailing list.  In order to unsubscribe from this list, send a message to
listserv@javasoft.com with the command 'signoff JAVA-INTEREST' in
the message body (not in the subject line).

home help back first fref pref prev next nref lref last post