Solved

Java Programming question

Posted on 1997-06-27
3
193 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
[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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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 …
This video teaches viewers about errors in exception handling.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

695 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