• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

file-servlet-jsp-file

 
rupa kalid
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My problem is getting around this issue
I have a text file ,in which i have a lot name, value pairs
eg name:value, i need a servlet to read this file, and pick out this name: value pairs, and write them into a jsp page, when the user makes changes to the jsp page, the servlet collects those changes and writes it back to the text file.
is this possible???
my id is rupakalidoss@hotmail.com
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlets can certainly read and write files on the system they are running on. The only thing tricky is getting the path and file name right.
If you want the user to edit and send back the data, your JSP page will have to write a form with a textarea. You set the initial textarea contents from the file and the revised contents will be sent back to the servlet doPost method. Any good HTML reference will give you the details.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic