Access Local Files on Server

Hello,Can a Java applet read and write files on the computer it is being served from?For example, a user connects to the server via a web browser and navigates to the applet. They enter information into the applet that needs to be saved on to the server.Can this be
[299 byte] By [bushstara] at [2007-11-27 2:37:16]
# 1
Not really. However, you can write a servlet to run on the server that will negotiate with the applet for operations to be undertaken locally to the server.Basically applets have the same access to the server that the browser does, and have the same limitations for the same
dcmintera at 2007-7-12 2:57:18 > top of Java-index,Java Essentials,New To Java...
# 2

That makes sense.

Could I create a servlet to write the whole program?

I am looking to create a program that will allow people to edit files on the server via a webpage. When connecting the servlet would load a file on the server to a text field, the user could edit it then save. On saving the servlet would save the changes to the file on the server.

bushstara at 2007-7-12 2:57:18 > top of Java-index,Java Essentials,New To Java...
# 3
Sure. Depends how user friendly you want to be really, but it's certainly possible.It all depends upon your own skills and the tools available to the audience you're targetting.D.
dcmintera at 2007-7-12 2:57:18 > top of Java-index,Java Essentials,New To Java...
# 4
Many thanks, please accept this Duke star as a token of my appreciation :)I have no servlet skills, but I am putting a "Servlet and JSP" book on to my O'Reilly bookshelf to see what I could do...
bushstara at 2007-7-12 2:57:18 > top of Java-index,Java Essentials,New To Java...
# 5

> Many thanks, please accept this Duke star as a token

> of my appreciation :)

The gesture's appreciated :-)

> I have no servlet skills, but I am putting a "Servlet

> and JSP" book on to my O'Reilly bookshelf to see what

> I could do...

This isn't too bad.

http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html

If you've a bit of Java you shouldn't find it too hard to get a basic JSP up and running. Frankly they're quite a bit easier to write than applets, although the configuration hoops can be painful to clamber through.

dcmintera at 2007-7-12 2:57:18 > top of Java-index,Java Essentials,New To Java...
# 6

I see that you do not need to any applet at all.

you can make an clean html form contains the fields you need and has an action which points to your Servlet, at submitting your form you can read any request parameters in your servet, then edit any file on server-side.

that's all.

Thanks.

Ahmad Elsafty

NourElsaftya at 2007-7-12 2:57:18 > top of Java-index,Java Essentials,New To Java...
# 7
Ahmad, I don't think that was necessarily a very helpful reply. Please make sure that you've read the whole thread before responding.
dcmintera at 2007-7-12 2:57:18 > top of Java-index,Java Essentials,New To Java...