This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes can we call a javaclass from a javascript function? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "can we call a javaclass from a javascript function?" Watch "can we call a javaclass from a javascript function?" New topic
Author

can we call a javaclass from a javascript function?

indu yeturu
Ranch Hand

Joined: Aug 27, 2008
Posts: 123
Hi

How to call a javaclass(with main method in it) from a javascript function ??


thanks,
indu
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42367
    
  64
A "main" method only has relevance if you want to start a Java application. Is that what you want to do, or do you just want to call some Java method and have it return some result to the JavaScript code?


Ping & DNS - my free Android networking tools app
bala nannaka
Ranch Hand

Joined: Apr 02, 2007
Posts: 49
With Ajax or DWR you can call a java class (Server side component) from a javascript function.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Re: DWR... That's *sort* of true, but you're not directly calling the java class. It *looks* like you are--but you're not. The difference may only be semantic, but it's a very important distinction to make.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
Moving to Javascript forum.
indu yeturu
Ranch Hand

Joined: Aug 27, 2008
Posts: 123
thankyou somuch for responding...
 
wood burning stoves
 
subject: can we call a javaclass from a javascript function?