Java Programing

June 17, 2007

That’s better, but suppose that the application actually

Filed under: Java Programming — webmaster @ 5:23 pm

That’s better, but suppose that the application actually has a legitimate reason to make its network connection. We’d like to leave the default security manager in place, just to be safe, but we’d like to grant this application permission to make a network connection. 3.2.2 The policytool Utility To permit our EvilEmpire example to make a network connection, we need to create a policy file that contains the appropriate permission. A handy utility called policytool , included in SDK 1.2 and later, helps you make policy files. Fire it up from a command line like this: C:> policytool You may get an error message when policytool starts up about not finding a default policy file. Don’t worry about this; just click OK to make the message go away. We want to add a network permission for the EvilEmpire application. The application is identified by its origin, also called a codebase . A codebase is described by a URL. In this case, it will be a file: URL that points to the location of the EvilEmpire application on your disk. If you started up policytool, you should be looking at its main window, shown in Figure 3.2. Click on Add Policy Entry. Another window pops up, like the one shown in Figure 3.3 (but with the fields empty). Figure 3.2. The policytool window Figure 3.3. Adding a policy entry First, fill in the codebase with the URL of the directory containing EvilEmpire as shown in the figure. Then click on Add Permission. Yet another window pops up, shown in Figure 3.4. Figure 3.4. Creating a new permission - 57

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Java Web Hosting