Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

options for writing to a file

 
Robert Stewart
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing an applet which amongst other things allows users to post comments, I'd like to handle as much as possible from within the applet. I'm looking for suggestions and feedback about which is the best way to go:
1. send a request to a servlet which writes the file (HTTP POST?)
2. send a request to a perl script with URL-encoded data (ex. process.cgi?name=value)
3. store the data in a database and access it directly with the applet
I'd like to avoid inconveniencing the user with extra steps, and I think using Perl might involve an extra "click" here and there. I'm also trying to keep the code functional for the java 1.1 jre.
Thanks - any info much appreciated!
Rob

 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either of the first 2 cases is fine, but applets are not restricted to only POSTing data to servlets - they can post to CGI's and other server programs as well. This is the nice thing about HTTP being a standard. The applet neither knows nor cares what language the server code is written in.
You wouldn't want case 3 if you're trying to keep it simple - direct applet-to-database communications run into sandbox and firewall problems.
 
Robert Stewart
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the information. Perhaps you could clarify a couple points about the servlet solution. The servlet is an application so it can write to files right? And if no one actually accesses the servlet directly, just through an applet, it can be coded in Java 2 and still work on a macintosh?
 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right on all counts! Of course, taking text files OUT of a Macintosh has its own perils, but you probably found that out long ago.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic