Create a Trust applet to access the local file system (1)
Written by Olexiy & Alexander Prokhorenko
Translated by Caiyi0903 (willpower), 2004.1.29
Creating a trusted applet that has access to the local client file system has been an important topic. Depending on the specification, many problems can only be performed on the client. Therefore, in many cases, those who are unfamiliar with the Trust applet technology generally find it impossible to operate on client files and search for other modes of operation. However, there is a way to do this and can be used widely in many ways. In this article, I'll show you an example to create a simple trust applet that will access a local text file you specify (note: You need to use a JDK1.3 or higher version).
First, I want to talk about the limitations we have to make on the client software. I would like to state that the signature applet given in this article is only suitable for clients with JDK (version 1.3) or similar plug-ins, and use IE more than 4 or Netscape 4.75 versions of browsers. In addition to these conditions, clients will not support the requirements of this article, and the creation of trusted signature applets for these older clients requires JDK1.1 technology, using the Javakey tool. Since the old way to create a signed applet has gone beyond the scope described in this article, it is necessary to explain here.
Now, let's talk about our (Programmer's) platform. We are using the Windows platform, with J2SDK 1.4.1 and Java container jakarta-tomcat 4.1.29 installed. If you are using the same software, then you can 100% guarantee that all the content described in this article will be perfect to run under your platform. Generally speaking, all the content described in this article should be able to run on compatible software.
Before I start coding, I want to explain why we need to find a specific, but not worthless, way to do these simple things, such as reading a file. There is a view in the Java 1.1 era that it is necessary to transfer a portion of the tasks to be performed to client computers with the help of applets to create a future generation of networked computers. However, this practice is not possible because the applet restricts security. Developers have also speculated that applets are a so-called "sandbox" (sandbox)----A simple location----does not allow reference to any system functions. With the development of Java technology, the Trust