PDA

View Full Version : Java Applet to query and display data from a text file


anawebhelp
12-08-2004, 03:30 PM
I wonder if someone can help me.

I need to include a Java Applet into my web page that will allow me to read and query data within a text file.

The Java applet needs to query the data from the text file and then organise the retreived data to be displayed on the web form.

I would appreciate help from anyone who can help me with this as I have knowledge of where to start with Java Applets.

cfc
12-09-2004, 01:42 AM
There are probably more efficient ways to accomplish your task than using java applets. With javascript, you could create an external .js file with your text in a spliceable variable or an array and import it with the src= property of the <script> tag, then process the variable as necessary. Due to the fact that I haven't used javascript in an extremely long time I can't determine if variable scope would be a problem by experiment, though it should probably work. (and if it doesn't there's probably a simple work-around). This way, the browser handles the request for the text and you remove the overhead of using the JRE to accomplish your task. The best option would be server-side programming, of course.