Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

what is ForbiddenTargetException?

 
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I implement an applet-servlet (using socket commu) client-server appl., in which I save a file to local drive in client side.
<code base>
try
{
try
{
PrivilegeManager.enablePrivilege ("UniversalFileAccess");

input = new BufferedReader(new FileReader(sourceFileString));

outputFile = new File(destFileString);
output= new BufferedWriter(new FileWriter(outputFile));

while ((line = input.readLine())!=null) {
output.write(line, 0, line.length());
output.newLine();
output.flush();
}
}
catch (SecurityException e)
{
System.out.println("Read/WriteFile\n: caught SecurityException");
return false;
}
catch (IOException ioe)
{
System.out.println("Read/WriteFile\n: caught IOException");
return false;
}

PrivilegeManager.revertPrivilege ("UniversalFileAccess");

}
catch(ForbiddenTargetException fte)
{
System.out.println("WriteFile\n: caught ForbiddenTargetException");
return false;
}
</code>
It gave me ForbiddenTargetException.
Please help,
Simon
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Guess you are using a Netscape browser.
The ForbiddenTargetException is thrown by Netscape. Try including the java40.jar in the classpath. If you are using Netscape 4.7, you will find this file in
\Program Files\Netscape\Communicator\program\java\classes
directory.
Hope it helps.
Suneel
 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, Suneel,
yes, I am using netscape commun4.7
I did copy java40 into jdk\jre\lib\ext. The program works when I use applet-java (socket). but when i shift to applet-servlet. The problem ForbiddenTargetException happens.
Could you guys help me? Thanks
Simon
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic