Solved

Java Programming question

Posted on 1997-06-27
3
188 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

763 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

6 Experts available now in Live!

Get 1:1 Help Now