Applet function call from javascript

Hi,
I'm haveing a problem with accesing applet's functions from Javascript in Mozilla. IE works fine but in Mozilla I get the following error:
Error: document.applets[0] has no properties
The code used is: document.applets[0].test();
The applet has the following 2 tags defined, I don't know if they are necessary here but I'm doing the reverse too (applet functions call javascript).
<PARAM name="MAYSCRIPT" value="Y">
<PARAM name="SCRIPTABLE" value="Y">
If you have any ideea please help.
Thanks

in javascript try document.getElementById("idOfTheApplet")
use object tag instead of applet tag:
     <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
              height="300" width="450" >
        <param name="code" value="appTest.class" />
        <!--[if !IE]> Mozilla/Netscape and its brethren -->
        <object classid="java:appTest.class"
                height="300" width="450"
                >
          <param name="mayscript" value=Y" />
        </object>
        <!-- <![endif]-->
      </object>or check out HtmlConverter.exe in the jdk bin dir.

Similar Messages

  • Java function call from Trigger in Oracle

    Moderator edit:
    This post was branched from an eleven-year-old long dead thread
    Java function call from Trigger in Oracle
    @ user 861498,
    For the future, if a forum discussion is more than (let's say) a month old, NEVER resurrect it to append your new issue. Always start a new thread. Feel free to include a link to that old discussion if you think it might be relevant.
    Also, ALWAYS use code tags as is described in the forum FAQ that is linked at the upper corner of e\very page. Your formulae will be so very much more readable.
    {end of edit, what follows is their posting}
    I am attempting to do a similar function, however everything is loaded, written, compiled and resolved correct, however, nothing is happening. No errors or anything. Would I have a permission issue or something?
    My code is the following, (the last four lines of java code is meant to do activate a particular badge which will later be dynamic)
    Trigger:
    CREATE OR REPLACE PROCEDURE java_contact_t4 (member_id_in NUMBER)
    IS LANGUAGE JAVA
    NAME 'ThrowAnError.contactTrigger(java.lang.Integer)';
    Java:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ThrowAnError" AS
    // Required class libraries.
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import com.ekahau.common.sdk.*;
    import com.ekahau.engine.sdk.*;
    // Define class.
    public class ThrowAnError {
    // Connect and verify new insert would be a duplicate.
    public static void contactTrigger(Integer memberID) throws Exception {
    String badgeId;
    // Create a Java 5 and Oracle 11g connection.
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    // Create a prepared statement that accepts binding a number.
    PreparedStatement ps = conn.prepareStatement("SELECT \"Note\" " +
    "FROM Users " +
    "WHERE \"User\" = ? ");
    // Bind the local variable to the statement placeholder.
    ps.setInt(1, memberID);
    // Execute query and check if there is a second value.
    ResultSet rs = ps.executeQuery();
    while (rs.next()) {
    badgeId = rs.getString("Note");
    // Clean up resources.
    rs.close();
    ps.close();
    conn.close();
    // davids badge is 105463705637
    EConnection mEngineConnection = new econnection("10.25.10.5",8550);
    mEngineConnection.setUserCredentials("choff", "badge00");
    mEngineConnection.call("/epe/cfg/tagcommandadd?tagid=105463705637&cmd=mmt%203");
    mEngineConnection.call("/epe/msg/tagsendmsg?tagid=105463705637&messagetype=instant&message=Hello%20World%20from%20Axium-Oracle");
    Edited by: rukbat on May 31, 2011 1:12 PM

    To followup on the posting:
    Okay, being a oracle noob, I didn't know I needed to tell anything to get the java error messages out to the console
    Having figured that out on my own, I minified my code to just run the one line of code:
    // Required class libraries.
      import java.sql.*;
      import oracle.jdbc.driver.*;
      import com.ekahau.common.sdk.*;
      import com.ekahau.engine.sdk.*;
      // Define class.
      public class ThrowAnError {
         public static void testEkahau(Integer memberID) throws Exception {
         try {
              EConnection mEngineConnection = new EConnection("10.25.10.5",8550);
         } catch (Throwable e) {
              System.out.println("got an error");
              e.printStackTrace();
    }So, after the following:
    SQL> {as sysdba on another command prompt} exec dbms_java.grant_permission('AXIUM',"SYS:java.util.PropertyPermission','javax.security.auth.usersubjectCredsOnly','write');
    and the following as the user
    SQL> set serveroutput on
    SQL> exec dbms_java.set_output(10000);
    I run the procedure and receive the following message.
    SQL> call java_contact_t4(801);
    got an error
    java.lang.NoClassDefFoundError
         at ThrowAnError.testEkahau(ThrowAnError:13)
    Call completed.
    NoClassDefFoundError tells me that it can't find the jar file to run my call to EConnection.
    Now, I've notice when I loaded the sdk jar file, it skipped some classes it contained:
    c:\Users\me\Documents>loadjava -r -f -v -r "axium/-----@axaxiumtrain" ekahau-engine-sdk.jar
    arguments: '-u' 'axium/***@axaxiumtrain' '-r' '-f' '-v' 'ekahau-engine-sdk.jar'
    creating : resource META-INF/MANIFEST.MF
    loading : resource META-INF/MANIFEST.MF
    creating : class com/ekahau/common/sdk/EConnection
    loading : class com/ekahau/common/sdk/EConnection
    creating : class com/ekahau/common/sdk/EErrorCodes
    loading : class com/ekahau/common/sdk/EErrorCodes
    skipping : resource META-INF/MANIFEST.MF
    resolving: class com/ekahau/common/sdk/EConnection
    skipping : class com/ekahau/common/sdk/EErrorCodes
    skipping : class com/ekahau/common/sdk/EException
    skipping : class com/ekahau/common/sdk/EMsg$EMSGIterator
    skipping : class com/ekahau/common/sdk/EMsg
    skipping : class com/ekahau/common/sdk/EMsgEncoder
    skipping : class com/ekahau/common/sdk/EMsgKeyValueParser
    skipping : class com/ekahau/common/sdk/EMsgProperty
    resolving: class com/ekahau/engine/sdk/impl/LocationImpl
    skipping : class com/ekahau/engine/sdk/status/IStatusListener
    skipping : class com/ekahau/engine/sdk/status/StatusChangeEntry
    Classes Loaded: 114
    Resources Loaded: 1
    Sources Loaded: 0
    Published Interfaces: 0
    Classes generated: 0
    Classes skipped: 0
    Synonyms Created: 0
    Errors: 0
    .... with no explanation.
    Can anyone tell me why it would skip resolving a class? Especially after I use the -r flag to have loadjava resolve it upon loading.
    How do i get it to resolve the entire jar file?
    Edited by: themadprogrammer on Aug 5, 2011 7:15 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:21 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:22 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:23 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:26 AM

  • Execute Oracle Package Function call from FORTE

    Has anyone EVER successfully execute an Oracle Package Function call from FORTE
    via " sql execute procedure "?
    Here's my question, I am able to execute a stored procedure but hasn't figured
    out a way to execute a function which defined in a package. The syntax goes
    like this: sql execute procedure <PackageName>.<FunctionName> ( input
    input_parm, output output_parm). If anyone EVER successfully execute a
    function, please let me know, thanks.

    You'll need to provide a column alias for the function call:
    select func(val) as alias from dual

  • CodeBase for Applet called from Javascript

    I have a Search applet that is called from an HTML form in a browser when a button in the form is pressed. The Applet searches files in a folder/subfolders and uses a JSObject to create a new page for the browser with results. Up until recently I was using the plugin from jre 1.3.1 with the appropriate FilePermission entries in the .java.policy file and the applet worked as expected. IE if I added new folders to be searched, I had to add new entries to the policy file to give permission.
    I then installed jre 1.4.2 and the applet started getting Security problems stating the program did NOT have FilePermission. I tried several changes to the policy file and finally found that if I put the FilePermission entries in the empty(Global) codeBase the applet would work.
    What changed between jre 1.3.1 and 1.4.2?
    I would like to understand how the system works, ie where is the true codeBase and not cop-out with giving global permission.
    Any suggestions?
    Also the Java Tutorial shows a Windows syntax for a path (uses \) : C:\testing\-
    The policytool gets confused when I try to enter this. I use double \\ and it takes it OK when I do a Save. But later if I use policytool again to make changes somewhere else in the policy file, the \\ are removed and I end up with: C:testing- in the policy file. So I do it manually with an editor.
    Norm

    I would agree. Remember that the changes you make to the policy file apply to all applets that will ever be run on the system, not only to your applet.

  • Calling from javascript a method which uses accesscontroller.dopriviledged

    Hello everybody!
    I've a problem in accessing my pc resources from a signed applet when calling methods from Javascript.
    If I try from start() or init() methods, I can do it, but as soon as I try from anoter method defined by myself, it throws this me an AccessControlException:access denied.
    I googled and found that I should use this code:
    KeyStore smartCardKeyStore= (KeyStore)
                 AccessController.doPrivileged(
                           new PrivilegedExceptionAction() {
                             public Object run() throws KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException, IOException {
                                 KeyStore alfa;
                                 alfa = KeyStore.getInstance("PKCS11",pkcs11Provider.getName());
                                 alfa.load(null,null);//this is the point where it trhew the AccessControlException
                                 return alfa;
                         );The problem is that with this code, I can't get it work with Firefox (which doesn't throw any exception, just won't work!) neither with IE, which throws this:
    netscape.javascript.JSException: Nome sconosciuto.
    java.lang.Exception: netscape.javascript.JSException: Nome sconosciuto.
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)Please, help me! I'm in a big trouble, since I should finish my project asap and I am not able to pass this cumbersome obstacle...
    Thank you in advance! :)

    Hi! Don,
    You cannot call methods which breach Security from Javascript. That is what SUN says.
    But there is a hack, or a work around...
    Declare a boolean Variable , say named buttonClicked.
    Initailly keep its value false(default).
    Write an inner class that extends a thread class whose RUN method will contain the following piece of Code:
    public void run(){
        while(buttonClicked){
                     KeyStore smartCardKeyStore= (KeyStore)
                 AccessController.doPrivileged(
                           new PrivilegedExceptionAction() {
                             public Object run() throws KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException, IOException {
                                 KeyStore alfa;
                                 alfa = KeyStore.getInstance("PKCS11",pkcs11Provider.getName());
                                 alfa.load(null,null);//this is the point where it trhew the AccessControlException
                                 return alfa;
    }You start the Thread inner class in your init method.
    So, its RUN method will continuously be waiting to go into the while loop.
    And in your start method you will set the +"buttonClicked"+ variable to true upon a Javascript onclick event of a button.
    So, the moment you click a button, you only set the buttonClciked variable to true in your start method--------
    This does, in no way breach security. So no exception is thrown.. But the code which breaches security is initiated by another thread other than that spawned the Applet; so the browser does not care anything about its privileges. It just lets the execution of the code.
    I hope it works for you; be in contact, if it doesn't.
    Thanks and Regards,
    Samba

  • Problems with RSA Signed Applets methods called by JavaScript

    Hi Folks,
    I need to give all permissions to an Applet used in an Intranet application, so I signed the jar containing it with a RSA self-cert and I did the same for all the other jar files userd by the applet.
    The applet runs under Java Plugin with JRE 1.5.0_06: I am requested by the browser to install the cert and all works fine.
    When a JavaScript function calls a public method of the applet I received a security exception when the code tries to read a system property.
    The same method works fine if called by the applet itself or by a gui event (i.e. a button click) inside the applet, so the problem seems to be related to the fact the applet is used by JavaScript (in Explorer 6).
    Does anyone know some way to overcome this problem????
    Message was edited by:
    piero

    If I may be so bold as to ask you to elaborate on this fix? I have encountered an identical issue, but I have no idea about your reference to your fix, sorry.

  • RFC function call from VB Script

    I have an RFC enabled function that I need to call from VBScript.  I was working through this issue as a BAPI call but after research and RFC not initialized error messages over and over I am coming to think that the issue is not how I was doing it but what I was trying to do with different objects. 
    I think the issue is that I was trying to call a RFC function with BAPI methods, I didnt understand that there was I difference but now I do.  I don't know how to initialize the RFC on the host system and unsure if I even have all of the components on the host system to make these function calls.
    The goal here is to call a function that passes 3 paramters and modifies a user object in SAP.

    Hello John,
       are you using DCOM Connector? I have a VBScript working correctly, using DCOM Connector, and consuming a Z function module defined as RFC.
    What's the error message you're getting?
    Regards
    Michael

  • Bapi Function call from Crystal reports 2008. import parameters syntax.

    Dear,
    I have an issue with calling a function directly from Crystal reports (2008) in the R3 system.
    (if this belongs in another thread , please add the link if moved !)
    I try to get data through function "BAPI_CLASS_GET_CLASSIFICATIONS".
    Till now all possible input parameters have no data-result.
    I already read other threads stating that 'for example' the Language key needs to be provided in a single character. 'E' in stead of 'EN'.
    I also already created a Z-wrap-function that fills out all input parameters 'hardcoded'. This works.
    clearly there are som syntax changes in passing the values to R3 when called from Crystal Reports.
    Can someone state which syntax has to be followed for numeric fields, for datefields etc. (so when i make these dynamical, I know which syntax should be the outcome of the formula)
    in my function that doesn't work I use these selections:
    (this function is called in a standard report only calling this function)
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_LANGU_ISO} = "E" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_LANGU_INT} = "E" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.T_CLASS_OBJECTS.OBJECT_TYPE} = "MARA" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.T_CLASS_OBJECTS.OBJECT_KEY} = "000000000000000085" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_CLASSNUM} = "DSWTEST" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_CLASSTYPE} = "001" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_KEY_DATE} = Date (2011, 08, 05)
    I already tried other languages or the 'EN' as input.
    (I would like to know how the date is passed exaclty to R3.)
    The function is of course RFC enabled.
    when I call the my Z-function with predefined inputparameters in R3 it does give the wanted result.
    FUNCTION ZBAPI_CLASS_GET_CLASSIFICATION.
    ""Local Interface:
    *"  TABLES
    *"      OBJECT_CLASSIFICATION STRUCTURE  BAPI_OBJECT_VALUES
    *"      CLASS_OBJECTS STRUCTURE  BAPI_CLASS_OBJECTS
    data ZOBJECT_CLASSIFICATION type TABLE OF BAPI_OBJECT_VALUES.
    data ZCLASS_OBJECTS  type TABLE OF BAPI_CLASS_OBJECTS WITH HEADER LINE.
    ZCLASS_OBJECTS-OBJECT_KEY = '000000000000000085'.
    ZCLASS_OBJECTS-OBJECT_TYPE = 'MARA'.
    Append ZCLASS_OBJECTS.
    CALL FUNCTION 'BAPI_CLASS_GET_CLASSIFICATIONS'
      EXPORTING
        CLASSTYPE                    = '001'
        CLASSNUM                     = 'DSWTEST'
    *   KEY_DATE                     = SY-DATUM
    *   LANGU_ISO                    =
    *   LANGU_INT                    =
    *   CHARACTS_OF_CLASS_ONLY       =
    * IMPORTING
    *   RETURN                       =
      TABLES
        OBJECT_CLASSIFICATION        = ZOBJECT_CLASSIFICATION
        CLASS_OBJECTS                = ZCLASS_OBJECTS
    OBJECT_CLASSIFICATION[] = ZOBJECT_CLASSIFICATION[].
    ENDFUNCTION.
    please advise.
    once again if this should be moved to another forum , add the link please!

    Dear,
    I just debugged my Z-function, after adding all input parameters as in the standard BAPI function.
    All parameters seems to be passed correctly except from the table parameters from
    CLASS_OBJECTS
    So all I_parameters are passed :
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_LANGU_INT} = "EN" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_LANGU_ISO} = "EN" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_KEY_DATE} = Date (2011, 08, 05) and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CLASSNUM} = "DSWTEST" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CLASSTYPE} = "001" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CHARACTS_OF_CLASS_ONLY.BAPIFLAG} = ""
    but the table parameters aren't coming through:
    {ZBAPI_CLASS_GET_CLASSIFICATION.T_CLASS_OBJECTS.OBJECT_TYPE} = "MARA" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.T_CLASS_OBJECTS.OBJECT_KEY} = "000000000000000085" and
    these are 'blanco' in the function.
    also after the function is executed and all data is retrieved, when passing the data back to Crystal reports, once again, the table result isn't passed to Crystal Reports.
    please advise

  • Duration of an Abap Function call from Java using Jco3

    Hi guys!
    I would like to use this discussion to get some refernces of the duration Timespan of an RFC call from Java to SAP. At the moment, i need at last about 200ms to call the Abap function. I'm just using one simple import and export parameter (so no deep structures). I think that the reason for my poor performance is, that the Java Tool and the SAP instance are not in the same network. So, i hope some of you have some data, how fast an RFC call from Java using Jco can be executed.
    greetings, Hannes

    Hi Hannes,
    I think you have already got the answer to your question - the network set-up you have is probably the bottleneck.  Whenever I've worked with Java <-> ABAP and they are in the same network, I've had no performance problems at all.
    Does your RFC contain any complex logic or business processes?  Are you able to try and call something that does nothing, say it just accepts an input string and returns it straight away as an export.  Do you have any scope for testing with your Java tool on the same network as the SAP system?
    Cheers,
    G.

  • Java functions call from C++ App

    Hi,
    I'm new to Java, One of our client have generic APIs for there business logic, those are written in JAVA, now we want to use some of these APIs in C++ application. Can any one suggest/address me the better way to do this?
    Thanks in advance.
    Thanks,
    --Ravi Kiran.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    To call Java functions from C++ you need a VM running in your process, and JNI is the interface you need to use in the C++ code.
    One of the interfaces in JNI lets you create a VM. You generally only want one VM, so if the application started out in Java, you have a VM already and you don't need to create one.
    Note that JNI is really a C <-> Java interface, and usually any C++ code called from Java is C++ 'extern "C"' functions. Java won't know anything about C++ objects. And you use JNI to get C++ to understand Java objects.
    Hope this was helpful.

  • Oracle Function call from JDBC Adapter

    Hi,
      Is it possible to call Custom Oracle Function from JDBC Adapter? 
    I know we can call stored procedure but I need to call Oracle function. Please explain how?
    Regards,
    Shweta.

    You'll need to provide a column alias for the function call:
    select func(val) as alias from dual

  • Oracle function call from XSQL

    Hi, Steve,
    We have trouble to make a function call in XSQL. Here is what we have.
    Function:
    create or replace function VerifyUser (valid in varchar2)
    return varchar2
    is
    begin
    return(valid);
    end;
    XSQL call:
    <PAGE xmlns:xsql="urn:oracle-xsql" connection="demo" istrue="ISTRUE">
    <xsql:query>
    select VerifyUser('{@istrue}') from DUAL
    </xsql:query>
    </PAGE>
    Error message returned:
    <PAGE istrue="ISTRUE">
    <ERROR>oracle.xml.sql.OracleXMLSQLException: Invalid character in name.</ERROR>
    </PAGE>
    Any idea what is wrong here?
    What we want is to get the out variable value onto the XSQL page.
    Thanks for help.
    null

    You'll need to provide a column alias for the function call:
    select func(val) as alias from dual

  • Help:Function call from CFScript

    I need to write a function call within
    <cfscript></cfscript> but not sure with the syntax. I
    got error message with the suntax I wrote (see below).
    All I need is for the function AddVal () to pass an Array
    within the existing loop.
    <CFSCRIPT>
    //Existing codes
    Function ExistingFunction(ParameterA) {
    //some codes here
    for ( i = 1; i LTE listLen( fileCon, crlf ); i = i + 1 ) {
    //some codes was written here to generate a 2 dimensional
    Array called: MyArray
    // I need to write my function here, so on every loop it
    will pass an array to be inserted to DB
    function AddVa(MyArray); >>>>> ??????????????
    <CFFUNCTION name="AddVal">
    <cfargument name="MyVal" type="Array" required="true">
    <cfquery name="MyQuery datasource="MyDatasource>
    // insert statement here
    </cfquery>
    </CFFUNCTION>
    </CFSCRIPT>

    pls try this.
    //syntax to call a function inside cfscript is given below.
    //variablename = functionname(pass ur argument);
    change ur code like this.
    <!--- First, clean up the CFSCRIPT block --->
    <CFSCRIPT>
    function ExistingFunction(ParameterA) {
    //some codes here
    for ( i = 1; i LTE listLen( fileCon, crlf ); i = i + 1 ) {
    //some codes was written here to generate a 2 dimensional
    Array called: MyArray
    getIP=AddVal(MyArray);//syntax to call a function inside
    cfscript.
    </CFSCRIPT>
    <!--- since you're doing a query move this function
    outside the CFSCRIPT block
    ...you can still call it from your CFSCRIPT block --->
    <CFFUNCTION name="AddVal">
    <cfargument name="MyVal" type="Array" required="true">
    <cfquery name="MyQuery datasource="MyDatasource>
    // insert statement here
    </cfquery>
    </CFFUNCTION>
    try this and inform.

  • Base64 decode with user defined function called from xslt

    I have an xml document which has a segment containing a b64 encoded attachment.
    I would like to decode the attachment as i map it.
    I would think this could be done by using a java function of some kind being called from the xslt however i have very limited experience in this and none in how to code the decoding.
    Anyone have an example ?
    Cheers
    Jon

    >
    Jon Vaugan wrote:
    > I have an xml document which has a segment containing a b64 encoded attachment.
    > I would like to decode the attachment as i map it.
    >
    > I would think this could be done by using a java function of some kind being called from the xslt however i have very limited experience in this and none in how to code the decoding.
    >
    > Anyone have an example ?
    >
    > Cheers
    > Jon
    yes SDN seems to have an example for you....it may not exactly solve your problem...but yes it not irrelevant.....you just need to do some R&D
    /people/farooq.farooqui3/blog/2008/05/22/decode-base64-incoming-encoded-information-in-sap-xipi-using-java-mapping
    Regards,
    Abhishek

  • Help,I am trying to get function calls from a flash file within an embedded SMIL file to work with Netscape.

    Basically, the functions are on the html document in which the SMIL file is embedded and the flash file within the SMIL file calls the function from a button.
    The code on the html doc determines whether the browser is Netscape or IE and then executes the appropriate code. For ex. for Netscape the function is:
    document.radio.SetSource('video.smi')
    and for IE the function is:
    radio.SetSource('video.smi')
    All the function calls work fine in IE but in Netscape it does nothing.

    Basically, the functions are on the html document in which the SMIL file is embedded and the flash file within the SMIL file calls the function from a button.
    The code on the html doc determines whether the browser is Netscape or IE and then executes the appropriate code. For ex. for Netscape the function is:
    document.radio.SetSource('video.smi')
    and for IE the function is:
    radio.SetSource('video.smi')
    All the function calls work fine in IE but in Netscape it does nothing.

Maybe you are looking for