• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading and Writing files using Java Script

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ranchers,
I'm using JSP and MySQl for my dynamic application. I've also created an admin option where the administrator can enable and disable the form fields and that is a bit hard coded.
Now what i'm planning is to put a hyper link in each page, which can be viewed by the Administrator for changing the security settings. When the hyperlink is clicked, i want the java script to read the form fields one by one in the clicked page and shows it in a pop-up window.
So that I can change the security settings from the web-page itself and when i save it, it has to write in the clicked file in the webserver and has to refresh with the new-security features.

Please help with your enriched ideas.

Thanks and regards

Aravind Prasad
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Friend,
That is not possible in Java Script. You cannot do it and read the file file and write the file which is opened. Because

1. Java Script is a client Side program and the files you are looking for is in the remote server.

2. The file reader can read the file in a particular folder. When you ask the file to reader to read a particular file, you have to map the drive with the drive name or the partitiion name in Linux.
for egs : fileReader.read("D:/abc/abc.jsp");
and when it comes in the webpage, you have to read the file like www.abc.com/abc/abc.jsp. So you have to put the mapping in the file reader.

3. Java Script to Database,you have to use CGI or AJAX for this

Please check the manual for File Streams for more details
 
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic