Java script java class

Discussion in 'Javascript' started by prashan.buddhika@gmail.com, Jul 28, 2008.

  1. Guest

    Hello,

    I need to access java class in a jar file using a javascript. Is there
    any way to do this other than using a java applet ? Please help ..

    Prashan
    , Jul 28, 2008
    #1
    1. Advertising

  2. Erwin Moller Guest

    schreef:
    > Hello,
    >
    > I need to access java class in a jar file using a javascript. Is there
    > any way to do this other than using a java applet ? Please help ..
    >
    > Prashan


    You didn't specify where this class in the JAR is.

    The problem is simple: JavaScript is executed in the browser.
    Java is not, unless you make an applet.
    If you do that, you can let them communicate.
    The easiest way to let JavaScript and Java communicate IN THE BROWSER is
    using this:
    http://java.sun.com/products/plugin/1.3/docs/jsobject.html


    If you need to use a class that is on the server, you cannot access it
    directly, but maybe this helps: You could create an Ajaxoid-call to a
    JSP page (or PHP, or whatever suits your needs AND can access java) that
    calls the appropriate function in the JAR for you on the server.

    If you need more help, be more clear on what you try to achieve.

    Regards,
    Erwin Moller
    Erwin Moller, Jul 28, 2008
    #2
    1. Advertising

  3. wrote:
    > I need to access java class in a jar file using a javascript. Is there
    > any way to do this


    STFW for "LiveConnect OR XPConnect". "Java JavaScript" would also do.

    > other than using a java applet ?


    Obviously, you cannot use a *Java* applet to access a Java class with
    *JavaScript* (or any other ECMAScript implementation).


    PointedEars
    --
    Prototype.js was written by people who don't know javascript for people
    who don't know javascript. People who don't know javascript are not
    the best source of advice on designing systems that use javascript.
    -- Richard Cornford, cljs, <f806at$ail$1$>
    Thomas 'PointedEars' Lahn, Jul 28, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. E11
    Replies:
    1
    Views:
    4,737
    Thomas Weidenfeller
    Oct 12, 2005
  2. christopher diggins
    Replies:
    16
    Views:
    747
    Pete Becker
    May 4, 2005
  3. Joseph Turian
    Replies:
    5
    Views:
    586
  4. Rajat
    Replies:
    3
    Views:
    689
    Jorgen Grahn
    Jan 8, 2010
  5. VYAS ASHISH M-NTB837
    Replies:
    2
    Views:
    551
    Jan Kaliszewski
    Jan 7, 2010
Loading...

Share This Page