but this code is not supported with tomcat
how to write intp a property file during run time( running an applet in tomcat)
so for this to happen, i'm initially trying to do the same with only one machine ( acting as server and the client ) but it is failing to store the values in the file while the values that are to be stored are correctly generating
You'll need to think about what happens if several of the client applets try to do that at the same time - which update should be the one that becomes permanent? The first one to arrive? The last one to arrive?
As I said before, you can't use file I/O from the applet to write to a file that is on some other machine. The applet will need to send whatever is to be stored to a servlet via HTTP, and then the servlet can write to the file.
so it would be better to have seperate property file in each of the clients machine...
but how to proceed with what you suggested..
a file accessed as "conf/propert.properties" through the classloading mechanism can NOT be accessed under the same name using regular file I/O. In fact, since that file lives on the server file system, it can not be accessed from the applet AT ALL. (Unless you intend for the applet always and only to be run on the same machine as Tomcat - in which case it would be a bit silly to make it an applet in the first place.)
you mean that an applet cannot write to a file to the server ( if server and client are different systems) using regular file i/o.
you also mean that it is possible if server and client are on the same machine.
and you also mean that it is some thing weird to run server and client on same machine.
but my question is why can't i write a file from applet if the server is also on the same machine?? ( if it is signed )
is this really neccesary to write to a file.
the code i have is writing to file in eclipse and not in browser... any changes in code?
IDEs frequently relax the security restrictions of applets, so the code you write may run inside the IDE, but then throw security exceptions in the browser if they're not signed. That's not really a code issue, though. The code should not have to change.
does this mean, we can still write a file from applet is we catch the exceptions thrown without being signed.
http://www.roseindia.net/java/example/java/applet/WriteFile.shtml
I just had the craziest dream. This tiny ad was in it.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|