Solved

Java Programming question

Posted on 1997-06-27
3
191 Views
Last Modified: 2010-05-18
I've made an simple applet which stores a mail address inputted fron the user. Then it writes the address to a file "maillist.txt", this goes perfectly when I use the random access method on my local machine, but as this is a applet, I should use an URL to save the information.
Then the problem is there are no random access methods in the URL package. Are there any workarounds for this, other than reading the whole datafile into the applet?
0
Comment
Question by:olavb
3 Comments
 

Expert Comment

by:weka
ID: 1222328
One way to go about this is to have a servlet handle the writing to the maillist.txt file server-side.  The servlet can use a random access method.  Then you just communicate with the servlet and send the data.  You can use a number of solutions for client-server-side communication including sockets in the java.net library, RMI, APIs like NSAPI and ISAPI (I believe) or a number of other tool based solutions.  Your choice is dependent on whether or not their is going to be more functionality that might be hosted server-side in the future.

- Weka
0
 
LVL 6

Expert Comment

by:jpk041897
ID: 1222329
Another posibility is to set up a complete server application on the server. And follow up on weka's advise.

The use of a Server or a Servlet would depend on the ammount of trafic you are expecting to handle. For small loads, servlets work fine. For high trafic, full server apps are better since they don't have to be reloaded each time a request is processed.


One final alternative, albeit more work, is to use JDBC and a data base. You could then make the requests dirrectly from the client and avoid a server/servlet solution. But this would imply using a straight JDBC driver, not and ODBC bridge, since a bridge would imply installing an ODBC driver on the client box.
0
 

Accepted Solution

by:
istiles earned 0 total points
ID: 1222330
If server side components do not interest you, there is another way...use a protocol other than HTTP that most likely the server already has support for--NFS or FTP.

Jentec makes a product that run-time determines what protocol to use to communicate with a server to allow file I/O, printing, and email support. The product is called JENI (Java Enterprise Network Interface) and currently supports NFS, FTP, LDAP, POP, SMTP, as well as local support. You write once to the JENI interface and JENI handles the differences between protocols and local access for you.

JENI provides an equivalent class for random access called "RandomAccessStream" which will work on the network or locally dynamically. You may use this class to open, seek to the end, and write your mail list information.

Another option is to use JENI to send an email message with the mail list information enclosed if you don't have other file I/O protocols loaded on your web server.

Hope this helps,

Ian Stiles
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…
The viewer will learn how to implement Singleton Design Pattern in Java.

809 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