calling signed applets from javascript

Posted on 2004-11-30
Last Modified: 2009-07-29

I have some applet that I have signed and that have to the some writing on the hard disc. This is for intranet application. When I save file from init method of applet or any method whic I called on applet form by pressing button that's work fine. But when I call applet method form javascript like myApplet.saveFile() that throws security exiption that it dont have permission to write to the disk. When I call applet methods from javascript that don't violete standard permission that work fine but I need to call those save methods to because half of my front end is in pure html. Obviously this is some security issue that I dont know and have to protect  calling of dangerous methods  by other people scripts. Can someone show me the way to do what I want and need to.
tia Cubrovic
Question by:cubrovic
    LVL 3

    Assisted Solution

    did you set the

          <PARAM NAME="scriptable" VALUE="true">

    tag in the <OBJECT> tag refering to the applet?
    LVL 7

    Author Comment

    I dont use object tag. I use applet tag . And didnt thintk that this is the issue because I can call succesfully any applet method from javascript but the one I use to save files.
    LVL 92

    Accepted Solution

    You need to sign the javascript, though I don't believe this is supported under IE.

    LVL 7

    Author Comment

    I kind of found a solution.
    I start thread from the applets init that check for every 300ms if there are some new action from javacript started and  from javascript I set just an action variable (String) that tell that thread what have to be done next.
    Not ideal solution bat we're not living in ideal world ;)

    Thanks for participating and you have points for that.
    If you have some observations on my solution I will love to here it. Before something explodes.

    LVL 92

    Expert Comment

    yes a similir workaround is to have your js calla method that queues the task to be performed, and then process those threads from another trusted thread.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Hire Top Freelancers to Complete Java Projects

    Source the talented Expert Exchange community
    for top quality work on your Java projects.

    Hire the best. Collaborate easily. Get quality work.

    INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now