Calling native Objective C code from Java Script

Hi,
I want to call native objective C code from Java script.
I know one way by using : webView:shouldStartLoadWithRequest:navigationType
Is there another way of doing same?
Thanks,
Ganesh Pisal
Vavni Inc

Are any of those threads calling java code? If yes then are you calling the Attach method?

Similar Messages

  • Call native function fflush & strprn from java

    Hi,
    I need to call a native function fflush and stdprn from java for printing a file.
    How can i call this function?
    Can any one help me with sample code.
    Thanks,
    rpalanivelu

    Thanks your reply,
    Actually my problem is need to take printout using dot matrix printer(text printer) with different font size.
    So, i am using native method which is available in c.
    in c program i am using fflush,stdprn and fprintf.
    Here i've attached my sample program also.
    #include <jni.h>
    #include "NativePrint.h"
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #define MAXLINE_LEN 100
    JNIEXPORT jint JNICALL
    Java_NativePrint_dotMatrixPrint(JNIEnv* env, jobject obj )
    FILE *fp;
    char filename[20];
    char line[100]; /* A line read from the file */
    int lineNumber = 0;
    /* Print control codes */
    char boldOn = 14;
    char boldOff = 20;
    char contentlenOn = 15;
    char contentlenOff = 18;
    printf("Printing from C3");
    strcpy( filename , "sayHello.c" );
    /* Open the file in read mode */
    fp = fopen( filename , "r" );
    /* Error in opening file, then exit */
    if ( fp == NULL )
    printf( "\nERROR: %s cannot be opened\n" , filename );
    exit( 1 );
    while ( fgets( line , 100 , fp ) != NULL )
    lineNumber++; /* Line we are about to process next */
    printf("%s",line);
    /* If this is the first line */
    if ( lineNumber == 1 )
    /* then print it in bold */
    //fprintf( stdprn , "%c" , boldOn );
    fprintf( stdprn , "%c" , contentlenOn );
    fprintf( stdprn , line );
    fprintf( stdprn , "%c" , contentlenOff);
    //fprintf( stdprn , "%c" , boldOff );
    else
    /* else print it in normal mode */
    fprintf( stdprn , line );
    fflush(stdprn);
    return 0;

  • JNI Calling  a multithreaded C code from Java

    Hi,
    I am new to JNI . I am calling a multithreaded C (in which threads are created at runtime )code from a Java application (swing) on some event . The application crashes and it says "pthreads mutex_lock()". I have added -pthread as a command line argument .But even this does not help although the build is proper .It crashes at runtime .All other JNI calls are working perfectly ...
    Please help .
    Thanks in advance ...
    Regards
    Rohit

    Are any of those threads calling java code? If yes then are you calling the Attach method?

  • How to call C/C++ - Code from Java?

    I would like to know if it is possible to call C or C++ - Code from Java and how to do.

    In short, yes you can do this.
    Have a look at http://java.sun.com/docs/books/tutorial/native1.1/concepts/index.html
    to see how...
    Good luck!

  • How to call backing bean method from java script

    Hi,
    I would like to know how to call backing bean method from java script.
    I am aware of serverListener and [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    but i am running in to some issues with [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    regarding which i asked for help in other thread with subject ....Question on AjaxAutoSuggest article (Ajax Transactions Using ADF and J...)
    The reason why i posted is ( though i realise both are duplicates) .. that threads looks as a specific question to that article hence i would like to ask the quantified problem is asked in this thread.
    So could any please letme know how to call backing bean method from java script
    Thanks
    Murali
    Edited by: mchepuri on Oct 24, 2009 6:17 PM
    Edited by: mchepuri on Oct 24, 2009 6:20 PM

    Hello,
    May know how to submit a button autoamtically on onload of page with clicking a welcome alert box. the submit button has managed button too to show a message on console using SOP.
    the problem is.
    1. before loading the page a javascript comes on which i clicked ok
    2. the page gets loaded and the button is there which gets automatically clicked and the managed bean associated with prints a message on console using SOP.
    I m trying to do this through server listener and click listener. the code is(adf jspx page)
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" binding="#{backingBeanScope.backing_check4.d1}">
    <af:form id="f1" binding="#{backingBeanScope.backing_check4.f1}">
    <af:commandButton text="commandButton 1"
    binding="#{backingBeanScope.backing_check4.cb1}"
    id="cb1" action="#{beanCheck4.submit1}"/>
    <af:clientListener type="click" method="delRow"/>
    <af:serverListener type= "jsServerListener"
    method="#{backingBeanScope.backing_check4.submit1}"/>
    <f:facet name="metaContainer">
    <af:resource type ="javascript">
    x=confirm("hi");
    // if(x){
    delRow = function(event){
    AdfCustomEvent.queue(event.getSource(), "jsServerListener", {}, false);
    return true;
    </af:resource>
    </f:facet>
    </af:form>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_check4-->
    </jsp:root>
    the backing bean code is -----
    public class classCheck4 {
    public classCheck4() {
    public String submit1() {
    System.out.println("hello");
    return null;
    }

  • How to Call a JSP from Java Script

    Hi,
    I want to call a jsp from Java Script.
    I am having IntelliJ IDEA 4.5 (IDE) and weblogic server.
    should i do anything on web.xml,weblogic.xml
    I have written one jsp, Java script.
    I want to call a jsp from Java script

    function submitf(){
    document.xyz.action ='ReportSave.jsp';
    document.xyz.method='POST';
    document.xyz.submit();
    <form name='xyz'>
    <input type='text' name='text1'>
    <input type='text' name='text2'>
    <input type='button' name='xx' value='submit' onclick= submitf()>
    </form>
    Is this what u want???
    Regards,
    RAHUL

  • Cannot Acccess Applet Object from Java Script

    Hi,
    I am using jRE1.5, and Kava Chart Applets. Those applet jars are compiled in jdk 1.5 version. I have created one jsp where I used ,<applet> tag. The problem is when ever I am going to access the applet object from java script it is not returning the actual java applet object, when put an alert message it shows [object]. So i am not able to access the methods or the applet class.and also the screen gets hung, nothing is coming.It get stuck at the point where i tried to access the applet method like document.getElementById(applet_id).<<<some method of the applet class>>.Also it is not showing any kind of javascript error or Applet class exceptions.
    But the strange thing is, when i use jdk 1.6, the page is running fine.Also when i try to print the applet object from javascript it is showing the proper class name.
    Please help me solving the problem.

    A number of changes and improvements were made between 1.5 and 1.6 - the entire plugin is new. You need to change to 1.6, as 1.5 goes EOL about November this year and future changes to this area in 1.5 are unlikely.

  • Opening ADF page from java script

    I am trying to use window.open(url, winName) to open an ADF page from java script.
    I have set the same winName but when i call the window.open method every time it opens up a new window.
    The code is as below:
    <html>
    <head>
    </head>
    <body>
    <script>
    function openwin() {
    window.open("about:blank", "winDocPrint", "width=800,height=600,location=no");
    </script>
    <form action="http://127.0.0.1:7101/RegionRefresh-ViewController-context-root/faces/EnterAndDisplay?_afrLoop=3611588465186&_afrWindowMode=0&_adf.ctrl-state=zoaas2mc3_4" target="winDocPrint" onsubmit="openwin">
    <input type="submit" value="Print Comments Call ADF">
    </form>
    </body>
    </html>
    when I click the button first time, it opens a new window, and keeps opening a new windows on clicking the button again.
    I want it to use the same window that was opened first time.
    Any help would be appreciated.
    Thanks,
    Sandeep M.
    Edited by: user8895611 on Mar 25, 2010 11:44 PM

    Hi,
    you need to keep the window handle reference so you can access the same window
    http://www.irt.org/script/874.htm
    Frank

  • JSP from Java Script???

    Can I call any jsp method from javascript?? I have a jsp page that contains some java script code..and I want to call one method of it from javascript.
    Thanks

    You can call applet methods or the methods that don't throw exception from java script otherwise not.

  • How to get the parameter from Java Script into the Parameter crystal Report

    Hi All,
    Crystal Report is integrated with Oracle 10g. I created the base SQL query for col1, col2, col3 and col4. Java Script pass parameter value (185) to Col1.
    My question is how to create crystal report to make Col1 as parameter and how to get the parameter value 185(Col1) from Java Script. Is there any additional code I need to include in the crystal report?
    FYI.
    Java script sends the right parameter value.There is no issue in java script.
    This is an automatic scheduled process when batch runs, Java script should pass the parameter value and the crystal report should get the value and produce the output report.

    Not sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
    If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
    Please clarify?

  • Calling a object of class from other class's function with in a package

    Hello Sir,
    I have a package.package have two classes.I want to use object of one class in function of another class of this same package.
    Like that:
    one.java
    package co;
    public class one
    private String aa="Vijay";  //something like
    }main.java:
    package co;
    import java.util.Stack;
    public class main extends Stack
    public void show(one obj)
    push(obj);
    public static void main(String args[])
    main oo=new main();
    }when I compile main class, Its not compile.
    Its give error.can not resolve symbol:
    symbol: class one
    location: class co.main
    public void show(one obj)
                              ^Please help How that compile "Calling a object of class from other class's function with in a package" beacuse I want to use this funda in an application

    kumar.vijaydahiya wrote:
    .It is set in environment variable.path=C:\bea\jdk141_02\bin;.,C:\oraclexe\app\oracle\product\10.2.0\server\bin;. command is:
    c:\Core\co\javac one.javaIts compiled already.
    c:\Core\co\javac main.javaBut it give error.
    Both java classes in co package.Okay, open a command prompt and execute these two commands:
    // to compile both classes:
    javac -cp c:\Core c:\Core\co\*.java
    // to run your main-class:
    java -cp c:\Core co.main

  • How can i get the source code from java concurrent program in R12

    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    Zulqarnain

    user570667 wrote:
    Hi 2 all,
    How can i get the source code from java concurrent program in R12? like , "AP Turnover Report" is java concurrent program, i need to get its source code to know its logic. how can i get its source code not the XML template?
    Regards,
    ZulqarnainDid you see old threads for similar topic/discussion? -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Java+AND+Concurrent+AND+Source+AND+Code&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • I just downloaded and instaled firefox 4. Now, everytime I institute a command I get a po[p-up from Java script that tells me to uninstal set. I cannot go on untin I press ok and then I am good for one more command and it starts with the pop-up again.

    I'm not even sure if this is an extension or plug-in and all I can tell you is what I have already stated. I can only make one command at a time and after each one I get a pop-up from Java script that says uninstal set. I must depress ok to move on, but only for one more command and it starts over again. This also happened when I tried to instal firefox 4 a couple months ago and I deleted the program and went back to an earlier version.

    Mail troubleshooting - Yosemite
    Troubleshooting sending and receiving email messages
    Troubleshooting sending email messages
    SMTP servers keep going offline

  • Calling shared objects in unix from Forms 6i and 10g

    I would like to know how to call shared objects in unix from Froms 6i and 10g. Can anybody help in this regard? Your help is very well appreciated.

    Hi,
    Do you have any 11i instance where those custom forms are used? If yes, you will have to copy those forms from 11i to R12 instance, open the forms using Forms 10g builder, compile it and upload it back to the server.
    Note: 427879.1 - How To Customize And Compile An Application Seeded Form (FMB) Or Library (PLL)?
    Note: 743490.1 - Customization in Oracle Applications
    Note: 563258.1 - How To Upgrade 11i Custom Forms And Reports To R12
    Regards,
    Hussein

  • How to print a Pdf from Java script

    Hi,
    I need to print a pdf from java script. In java script i have url of pdf. Is there any way to print pdf from java script?
    I am able to print word doc by ActiveX. is there any activeX or something else which do the same thing for pdf?
    Any help heartily esteemed to me.
    Thanks
    Kamlesh Sharma

    you are cross postin .. your thread has been answered in the jsp jstl forums

Maybe you are looking for