File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Call Javascript methods from Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Call Javascript methods from Java" Watch "Call Javascript methods from Java" New topic
Author

Call Javascript methods from Java

Alok Panda
Greenhorn

Joined: May 11, 2008
Posts: 22
Dear All,
I have a requirement where I need to invoke Javascript methods from a Java file located in the same machine. Are there any possible solutions for this?

Regards,
Alok
Ove Lindström
Ranch Hand

Joined: Mar 10, 2008
Posts: 326

You could use the Java Scripting engine to invoke the JavaScript.

http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

This article may interest you.


[My Blog]
All roads lead to JavaRanch
Alok Panda
Greenhorn

Joined: May 11, 2008
Posts: 22
Thanks to you both. You both refer to the same article.
The article definitely helps, but we are using Java 5 and not Java 6

Regards,
Alok
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
we are using Java 5 and not Java 6

In that case BSF is for you. Or you can use the Rhino JavaScript engine directly.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Call Javascript methods from Java