Can I call my own custom java class from JavaScript?

You can instantiate a "JavObject" from client-side JavaScript:
http://developer.netscape.com/docs/manuals/js/client/jsref/javobj.htm#1193137
What I don't know is, does JavaObject mean only the browser's JRE classes? Can I instantiate a class I wrote?

Also, does this even work in IE anymore? I'm trying it and it doesn't seem to work! Anyone know if this feature was removed? I have the latest Java plug-in.

Similar Messages

  • Calling Custom Java Class from WCC?

    How do I call a custom Java class from WCC when a certain metadata field is set to 'On' and at the time of check-in?
    Thank you,
    Randy

    Randy,
    You would only use the Intradoc classes if running as a service, service handler, filter or class alias as a component within WebCenter Content. In this case, since it is running inside WebCenter Content, you do not need to bundle the Intradoc classes since they are already on the classpath.
    If you are trying to code something that will not run inside WebCenter Content, you want to use RIDC: http://jonathanhult.com/blog/2012/12/ridc-examples/
    Jonathan
    http://jonathanhult.com

  • Accessing java classes from javascript

    Hi,
    I have the following javascript function
    function testjava {   
        var myString = new java.lang.String("Hello world"); // line 1
        alert("len:"+myString.length()); // line 2
    }It gives me a error at line 1 saying "'java' is undefined" in IE browser 5.5 sp2. But, both the lines execute correctly in netscape 6.
    Can someone please help..
    Thanks,
    Vijay.

    It seems that IE 5.5 doesn't support accessing java classes in JavaScript, so try to install IE 6 to see if it works or maybe, you doesn't have installed propertly support for JVM in IE.

  • Clearing custom java classes from cache

    Hi,
    I've written some java classes and am accessing them via the "cfobject" tag.
    My problem is that each time I recompile my java program, coldfusion continues using a cached version of my custom class' bytecode... so I can't really see my changes without restarting coldfusion.
    (I've turned off all caching in the cfadmin, but it doesn't seem to help)
    Any ideas on how to do this would be appreciated.
    (using coldfusion 8)

    found the answers here
    http://forums.sun.com/thread.jspa?forumID=764&threadID=5330127

  • How can I compile and run other java classes from within an application?

    Hello there everyone! I really hope that someone can help me. I am writing a program that must be able to compile and run other java classes that are in different files, much like development environments like Kawa or Forte allow you to do.
    There has to be a way of doing this ( I hope!! ), but i can't seem to find it!!
    I have tried using this command to compile:
    Runtime.getRuntime().exec ("c:\\programs\\javac className.java");
    ...and this one to run:
    Runtime.getRuntime().exec ("c:\\programs\\java className");
    ...but neither works!!! I can compile and run classes that are in the same file as my application, but I can't get it to work at all for files in different directories or files.
    PLEASE, PLEASE, PLEASE help me - i've run out of ideas, and i need this to be working in 3 days!!!
    Thank you very much for any help anyone can give me, I really appreciate it!! Thanks again!!
    Adrian ( ...in distress!! )

    public class JavaCompiler{
       public static void main(String[] args)throws Exception{ //sorry bout the laziness
          if(args == null || args.length != 1){
             System.out.println("Usage: java JavaCompiler MyClass.java");
             System.exit(0);
          String className = args[0];
          Runtime rt = Runtime.getRuntime();
          Process p = rt.exec("javac " + className); //consider setting cpath for this
          p.waitFor();
          //now try to run after it is done.
          p = rt.exec("java " + className.substring(0, (className.length() - ".java".length()));
          p.waitFor();
          //do some other stuff
    }This should get you going. You may consider looking into the System.getProperty() method in order to determine the type of OS it is running on in order to findo out what command to run. I know that the sun tool listed above is nice, but by my understanding the sun tools provided are not guaranteed to stay the same. I'm no expert on this matter, but that is one of the reasons there is no API documentation for those tools. Also, I don't believe those tools come packaged with the JRE. (Of course if you are making an IDE it will be expected that the user has an sdk installed. Good luck with figuring this thing out.

  • How to call java classes from javascript?

    i have a button which calls javascript i need to access a class to update the values in the database.. how do you call the java code from within the javascript?
    the class is stored under tomcats classes directory and is accessed:
    com.Database.Employee
    the method is called : UpdateEmployeeDetails
    the button
    <input type="button" value="Save" onclick="submitForm('save')" />the javascript
    <script language="javascript">
            function submitForm(process){    
                document.myForm.action="update.jsp";
                document.myForm.submit();
    </script>

    is it not possible?
    do i have to refresh the page and read in the values like...
    <%
    String ename = request.getParameter( "EmployeeName");
         session.setAttribute( "ename", ename);
    %>and then call the class from here?
    looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
    is ajax better or not really worth it?
    i have anything up to 100 fields that need saving at one save click

  • I can't call more than 1 Java method from C

    Hi friends,
    I my program written in C i call two Java methods, but the first method execute correct but the second display a error message:
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6d475879
    Function name=JVM_FindSignal
    Library=d:\jdk1.3.1\jre\bin\hotspot\jvm.dll
    I inverted the functions, but ever the second function makes a error.
    This is my C program:
    #include "jni.h"
    #include <stdio.h>
    #include <windows.h>
    #include <stdlib.h>
    #include <string.h>
    char *getclasspath()
    char ambiente[100000];
    static char result[200000];
    strcpy(ambiente,"-Djava.class.path=");
    strcat(ambiente,getenv("CLASSPATH"));
    int tam=strlen(ambiente),i,tamresult=0;
    for(i=0;i<tam;i++)
    if(ambiente!='\\')
    result[tamresult++]=ambiente[i];
    else
    result[tamresult++]='\\';
    result[tamresult++]='\\';
    result[tamresult]=0;
    return result;
    char **__stdcall getServerList(int sessionId)
         JavaVM *vm;
         JNIEnv *env;
         JavaVMInitArgs vm_args;
         JavaVMOption options[1];
         options[0].optionString = getclasspath();
         vm_args.version = JNI_VERSION_1_2;
         vm_args.options = options;
         vm_args.nOptions = 1;
         vm_args.ignoreUnrecognized = 1;
         jclass cls;
         jmethodID mid;
         char *retorno;
         int i=0;
         int k=0;
         int j=0;
         char aux[100][100];
         char *lista_server[20];
         char **lista_server_ret;
         /* Invoca a m�quina virtual Java */
         jint res = JNI_CreateJavaVM(&vm, (void **)&env, &vm_args);
         if (res < 0)
              printf("Can't create Java VM\n");
              exit(1);
         /* Procura pela classe */
         cls = (jclass) env->NewGlobalRef(env->FindClass("br.com.cpqd.sagre.security.argus.SagreWebWrapper"));
         if (cls == 0)
              printf("Can't found br.com.cpqd.sagre.security.argus.SagreWebWrapper class\n");
              exit(1);
         /* Procurando o metodo Java getListServerStr */
         if ((mid = env->GetStaticMethodID (cls,"getServerListStr","(I)Ljava/lang/String;")) == 0)
              fprintf (stderr,"Metodo nao encontrado Str\n");
              exit(1);
         jint param = (jint) sessionId;
         /* Executa o m�todo */
         jstring str_java = (jstring) env->CallStaticObjectMethod(cls,mid,param);
         retorno = (char *) env->GetStringUTFChars(str_java,0);
         vm->DestroyJavaVM ();
         int len = strlen(retorno);
         for(i=0;i<len;i++)
         if(retorno[i]!=' ')
              aux[k][j]= retorno[i];
              j++;
         else
              aux[k][j]='\0';
              k++;
              j=0;
         for(i=0;i<k;i++)
              lista_server[i] = aux[i];
         lista_server_ret=(char**)lista_server;
         return lista_server_ret;
    char __stdcall encrypt(char clearText)
    static JavaVM *vm;
    static JNIEnv *env;
    JavaVMInitArgs vm_args;
    JavaVMOption options[1];
    options[0].optionString = getclasspath();
    /*     "-Djava.class.path=.;.\\SagreUtil.jar";*/
    vm_args.version = JNI_VERSION_1_2;
    vm_args.options = options;
    vm_args.nOptions = 1;
    vm_args.ignoreUnrecognized = 1;
    jclass cls;
    jobject obj;
    jmethodID mid;
    char *retorno;
    /* Invoca a m�quina virtual Java */
    jint res = JNI_CreateJavaVM(&vm, (void **)&env, &vm_args);
    if (res < 0)
    printf("Can't create Java VM\n");
    /* Procura pela classe */
    cls = env->FindClass("br.com.cpqd.sagre.security.argus.SagreWebWrapper");
    if (cls == 0)
    printf("Can't find br.com.cpqd.sagre.security.argus.SagreWebWrapper class\n");
    /* Procurando o metodo Java encrypt */
    if ((mid = env->GetMethodID (cls,"encrypt","(Ljava/lang/String;)Ljava/lang/String;")) == 0)
    fprintf (stderr,"Can't find the encrypt method\n");
    exit(1);
    jstring param = (jstring) env->NewStringUTF (clearText);
    /* Instancia o metodo */
    obj = env->NewObject(cls,mid,param);
    /* Executa o m�todo encrypt */
    jstring str_java = (jstring) env->CallObjectMethod(obj,mid,param);
    if(str_java!=0)
    retorno = (char *) env->GetStringUTFChars(str_java, 0);
    else
         vm->DestroyJavaVM ();
         return NULL;
    /* Destroi JVM */
    vm->DestroyJavaVM ();
    return retorno;
    int main()
         char **teste;
         char *wilson;
         teste = getServerList(-1);
         printf("Fine %s",teste[1]);
         wilson = encrypt("blablabla");
         printf("%s",wilson);
    I appreciate for any reply.
    [ ]'s
    Bruno

    vikram ..
    if u r using ms vc++ then there is an option in the directories tab to specify various include files.
    if this doesn't work then u can use the command line compiler for vc++ , cl.exe. using cl u can give the -I option and specify the path of whatever file u want to add.
    as for the specific file <jni.h> u can find it at :
    driveletter:\jdk1.x\include
    though i have never used this file as an include statement in .c files that i use for jni.
    Dum Spiro Spero

  • Can we call Java class from LiveCycle Process?

    hi..
    I have a general query, is it possible to call customeized java class from Workbench Process?
    I found dat we can invoke a web service... is there some operation like that for calling a java class...
    Thanks and Regards,
    Ambika

    Yes.
    You can use the Script service and put your Java code in there
    Or build your own component, which is really a Java pojo, and deploy it to LiveCycle. See http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000934.html.
    Jasmin

  • Calling Custom XSLT java class from BPEL in SOA Suite 11g

    Hi All,
    Morning...need some help with this issue...we are currently on SOA Suite 11g (11.1.1.4) version.
    Earlier while we were on SOA Suite version 10g (10.1.3.3) we were calling the custom java classes from the xsl mapping for complex transformation and for this we were placing the .class file as .jar file at the location mentioned here $OC4J_HOME/j2ee/home/applib directory and then mentioning the namespace as http://www.oracle.com/XSL/Transform/java/{$classname$} in the XSLT mapping file.
    Now in SOA Suite 11g if we need to retain similar functionality for external custom java calls could someone please help us where do we need to put the .jar file now ..
    exactly at which directory location/path and on which instance/server (application server instance or middle tier instance ) we need to put this .jar file
    Currently we are stuck and need some help with this.
    With thanks & Regards

    Hi Eric & Anuj,
    Thanks for replying , sorry for checking on this now...
    here at this path /opt101/app/oracle/SOAD/SOA11gR1/fmw/Oracle_SOA1/soa/modules/oracle.soa.ext_11.1.1
    we got the ora.soa.ext.jar file and extracted it to get the MANIFEST.mf file ..have mentioned below.
    Now if we need to link our custom .jar file named customfunctions.jar so we need to mention it as below is this correct :
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: 17.0-b17 (Sun Microsystems Inc.)
    Implementation-Vendor: Oracle
    Implementation-Title: Oracle SOA EXT
    Implementation-Version: 11.1.1
    Product-Name: Oracle SOA EXT
    Product-Version: 11.1.1.4.0
    Specification-Version: 11.1.1
    Extension-Name: oracle.soa.ext
    Class-Path: classes/
    Class-Path:customfunctions.jar classes/ -- is this the way to mention (means we need to add this additional line or we need to add to the existing line at Class-Path: classes/)
    2.
    Eric the Alternative method mentioned in your update :
    Open a command prompt and change the current directory to the oracle.soa.ext_11.1.1 directory ,
    then execute the build.xml file in the oracle.soa.ext_11.1.1 folder using Ant
    Now could someone please guide us regards this ANT means how does it work and its relation to the build.xml file and how do we check whether we have ANT utility available or not..
    not much conversant with this ANT hence asking here..would lookout for your reply
    thank you

  • Is there an easy way to call a java class from an applet?

    Does anyone know of an easy way to call a server based java class from an applet? Has anyone done it or came across it? If yes how/where?
    Cheers, Chris.

    I'm not sure about the issue. Are you talking about "servelets"? "RMI"? Take a look at those issues.

  • Auto-launch Java classes from deliveries

    I need to launch custom java class from deliveries like described in this article (http://oraclebizint.wordpress.com/2007/12/17/oracle-bi-ee-101332-calling-java-scripts-and-java-classes-from-ibots/). The problem is that I want to launch my java code with all reports and hide it from application users. Is it possible?

    You can use the standard JMS Session API available to create a Queue or Topic identity object.
    i.e. Queue _myQueue = _session.createQueue("xxxxxxxxxxxxxx");Note that while this is a portable API, the syntax of the name parameter may not be portable across providers.
    Further, this only creates the Destination identity object and not the physical Destination object.
    For Sun MQ, when this identity object is used to create a producer or consumer, the physical destination is 'auto-created' if the broker is operating with factory defaults.
    Other providers may not support the 'auto-creation' facility or even if supported, it may be turned off by the administrator, in which case the application needs to handle those cases to be a provider-independant JMS application.

  • 11g iBots(Agents) calling custom java class?

    We upgraded from 10g to 11g and we have iBots that call a custom java class in the form of a jar file.
    This all worked fine in 10g.
    I followed all configuration steps in the documentation, but we are unable to get our iBots(Agents) to work in 11g.
    Keep getting "Can't find Class" errors.
    Has anyone successfully created agents that call custom java classes with 11g, if so, can you please share your steps for doing this?

    Hi glova,
    The document refers to the RPD and catalog migration....what ever customization used in 10g wont effect in 11g i suppose most of the things.
    i would suggest you to copy the java class of ibots and do the copy paste or manually do it in 11g and see if it works ...this is the only alternative.
    hope helps you.
    Cheers,
    KK

  • How can I call a java class from within my program?

    I was wondering if there's a platform independent way to call a java class from my program.

    Here's my scenario. I'm working on a platform independent, feature rich, object-oriented command prompt program. The way I'm designing it is that users can drop classes they write into my bin directory and gain access to the class through my program. For example, they drop a class named Network.class in the bin directory. They would type Network network at my command prompt and gain access to all the methods available in that class. They can then type system.echo network.ipaddress() at my prompt and get the system's ip address. I have it designed that there's a server running in the background and the clients connect to my port. Once connected the end-user can enter their user name and password and gain access to the system. When they type a command they actually call another java program which connects to my server using a seperate thread. They can then communicate back and forth. I have it set that everything has a process id and it's used to keep track of who called what program. Once the program is done it disconnects and closes. Rather than getting into the nitty gritty (I didn't want to get into heavy detail, I know how everything will work) I'm really interested in finding out how I can call a java program from my program. I don't want it to be part of the app in any way.

  • Custom Java class called from RTF template generates error

    We are running a report in BI Publisher and the report calls a custom developed Java class that is used to bind PDFs together and sent the result to another application.
    On the RTF template we have some XSLT that reads the input XML and sets a variable which is then passed to the Java class. We are however getting the following error when the report is called simultaneously 2 or more times:
    XML-22044: (Error) Extension function error: Error invoking 'JavaClassName': 'java.lang.Error: Cannot interweave overlay template with pdf input, combined number of pages is odd!
    I read this as the real cause of the error is the Java code but I'm not 100% sure. Also I don't understand what the error message means.
    Could someone help out please?
    Many thanks

    Since our this requirement is in Quotes module, its not using OAF. It is using plain JSPs and java classes.
    What i was thinking is, create the Option values as flex fields, and write a custom java class to fetch these data from the flex tables and use it in the JSP.
    The main problem we are facing now is,
    "...we wrote a simple java class, which establishes database connection, executes a simple insert & select query to our custom table. compiled & placed the class file under our new pkg structure under $JAVA_TOP eg. oracle.apps.xxx.quot.tmpl , bounced the apache."
    But when we tried to import this class in the jsp (which is being customized), the app just throwed Internal Server Error and we couldnt find any info in the Log file.
    Couldnt guess, why is this simple thing failing. Any idea ?

  • Call java class from xquery

    Hi All,
    I'm working on osb 11.1.1.5 version.As per my requirement i want to call the external java class from the Xquery (version 1.0).Anybody can u please provide me any links or examples?
    Thanks in Advance!
    Radhika.

    Hi Prabu Thx for ur reply....without custom functions is there any possibilities to do this from xquery?

Maybe you are looking for

  • Can not deploy Oracle Spatial Routing Engine on Oracle Weblogic

    I posted my question with Oracle Support, however they directed me to the oracle forums. I am hoping this problem can be resolved here. In any event I am getting the following stack trace (shown below). I am using Spatial Version 11.2.0.1.0, Map View

  • ITunes won't open after latest OSX update

    AFter latest OSX update iTunes won't open.  Reinstalled iTunes.  Reinstalled OSX update.  When I click on icon in applications or in finder nothing happens.

  • Scan works, print says it works but doesn't

    Hi all! Everyone seems to have the opposite problem - wireless printing works but scan doesn't. Not me! I can choose "scan" from my printer OR computer interface and it starts right up. Problem is, when I go to print it goes through the "printing" sc

  • 23" HD Cinema sends my 10.4.8 (G5 SP1.8) into a kernel panic shutdown

    Ever since the latest OS 10.4.8 update my machine randomly shutdown in 2 to 12 hours. After trying every thing imaginable I finally found that bypassing the displays USB hub it works like before the update! It has been up now for 4 days and my finger

  • How do I get my computer to recognize my Z

    I've just downloaded creative media source to Windows XP. I'm unable to rip a CD to my Zen Jukebox, because the right-side panel doesn't show the MP3 player under the "My Computer" heading. What am I doing wrong? Thanks in advance.