Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JavaScript calling java methods

Reply
Thread Tools

JavaScript calling java methods

 
 
ezhilvel@gmail.com
Guest
Posts: n/a
 
      03-07-2008
Hi

Is there any possibility of javascript calling java methods.. it is
possible in case of java program using applet and even possible with
JSP. Is it possible to get on with the usual Java classes. Let me know
if thats possible..

Thanks..
 
Reply With Quote
 
 
 
 
GArlington
Guest
Posts: n/a
 
      03-07-2008
On Mar 7, 5:57 am, ezhil...@gmail.com wrote:
> Hi
>
> Is there any possibility of javascript calling java methods.. it is
> possible in case of java program using applet and even possible with
> JSP. Is it possible to get on with the usual Java classes. Let me know
> if thats possible..
>
> Thanks..


Yes.
You will have to load java class into javascript accessible DOM
though...
 
Reply With Quote
 
 
 
 
alexa.smith@gmx.net
Guest
Posts: n/a
 
      03-07-2008
On Mar 7, 6:57 am, ezhil...@gmail.com wrote:
> Hi
>
> Is there any possibility of javascript calling java methods.. it is
> possible in case of java program using applet and even possible with
> JSP. Is it possible to get on with the usual Java classes. Let me know
> if thats possible..
>
> Thanks..


Hi!

Yes it's possible.

For example you has a applet with tag name="MyApplet".
From JavaScript you can call the "public"-Method "public String
getAnything() {...}" of the Applet with MyApplet.getAnything();

Important: Only the public Methods of your Applet-class are callable!

Give me feedback if it works!

regards
Alexa
 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      03-08-2008
wrote:
> Is there any possibility of javascript calling java methods.. it is
> possible in case of java program using applet and even possible with
> JSP. Is it possible to get on with the usual Java classes. Let me know
> if thats possible..


Yes.

It is in the Java documentation.

For Java 1.5 -
http://java.sun.com/j2se/1.5.0/docs/...e/js_java.html

Arne
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Design question - methods calling methods Rhino Java 49 05-29-2010 03:16 AM
calling class methods from class methods, help? Oltmans Python 6 03-11-2009 07:59 PM
Is there a way to find the class methods of a class, just like'methods' finds the instance methods? Kenneth McDonald Ruby 5 09-26-2008 03:09 PM
Avoid calling non-final methods in a constructor: Applies to static methods too? Oliver Wong Java 14 06-13-2006 09:18 AM
Calling java.lang.Runtime methods from C - help Stephen Kellett Java 3 01-26-2005 08:07 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57