Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 29th, 2001, 08:50 AM
ryki7 ryki7 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 0 ryki7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to ryki7
Question help!!! passing info to text file

Hello, I am extremely new to java and I just need some basic advice. My company develops statistical models that read from text files. I want

a)people to be able to go to my site enter values into a form and pass those values to a text file.

b)execute the model (nothing special just like calling a regular .exe)

c)display the results from a text file (the model writes to a text file) into the browser

I understand that this is very basic stuff but I need somewhere to start. Could I have some advice? If you could point me to any articles, code, tutorials on this I would really appreciate it.

Ryan

Reply With Quote
  #2  
Old July 4th, 2001, 05:54 AM
qafter qafter is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 0 qafter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Servlets will handle those tasks quite easily. Youll have to import java.io.*;

For writing to a file, you could use something like

FileWriter writer = new FileWriter("user/default/file.txt");
BufferedWriter doWrite = new BufferedWriter(writer);
doWrite.write("Testing");
doWrite.flush();
doWrite.close();
writer.close();

For Reading use something like this

FileReader reader = new FileReader("user/default/file.txt");
BufferedReader doRead BufferedReader(preader);
String whatever;
//Then for each line to read in use
whatever=doRead.readLine();
doRead.close();
reader.close();
//Once you invoke the readLine() method the pointer automatically hops to the next line, so whatever=doRead.readLine(); will read in the next line without you having to jump to it.

Do a search on google for "doGet" and "getParameter()" for handling forms.
I hope this helped.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > help!!! passing info to text file

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap