can servelt create a new directory and file on client machine?


Web tier: servlets, JSP, Web frameworks: can servelt create a new directory and file on client machine?

  1. as the title.

    Also, I'm wondering if JavaBean can create a new directory or file on client machine cause I know java applet would have trouble doing so.

  2. Actually, I'm thinking if servlet or javabean or others can store a file on client's hard disk or cache, so that when the user works on these files, he can work on his own machine, then display results in browser?

    Is anyone have such experience or heard sth like this?


  3. You better read your Applet and JavaBeans tutorial again, because your question doesn't make sense. JavaBeans are not something that can be loaded into a client's machine independently. If you intend to run them through applets, then of course they will be subject to all the normal applet security policies.

    Unless there is a bug in the JVM's security management, no code loaded remotely should ever be able to access a client's file system. There have been some limited bugs of this sort but there is no widely known one in the current JVMs, to my knowledge.

  4. Thanks for your reply first, I think I didn't state my questions quite clear. What I wantto know is if servelt or javabean can store files (data file) on client's machine (hard disk, cache, cookie, whatever), so that my jsp file (mainly an applet) will execute computations using these data at the client-side and also use client-side resources (cpu, memery, so on).

    Because I know can store the content of data file (the case I know is an xml file) into client's cache and then compute on client machine. So I'm wondering if servlet or javabean have this functions, either?

    Actually, I have already created an digital signed applet and can read/write file on client's machine. But it works well sometime and walks out sometime, also takes a little longer time. So I'm wondering if I can use servlet or javabean instead of a signed applet?

  5. A JSP page or a Servlet can put a cookie on the client's box, if the client's browser security policy allows it.
    Servlets and JSPs run on the server. There is no way for them to use the client's computational resources. They can load an Applet in the client's browser and pass it the contents of the stored cookie, if that's what you mean. I'm not sure whether there is a way to access the cookie directly from the Applet though.

    Of course this doesn't apply to signed applets. They can (assuming the user gave signed code appropriate permissions) access the file system and do whatever you want.

  6. i am a newbie,studying java...........