File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Call javascript from Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Call javascript from Java" Watch "Call javascript from Java" New topic
Author

Call javascript from Java

sindhu sheela
Greenhorn

Joined: May 20, 2008
Posts: 26
Hai,

I want to call a javascript funtion from a java code.
Is their a way to do it?(Is their any Class to call javascript from Java).

Im working in a struts1.29 application.

Thank You
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Yes, that's possible. Java 6 introduced the javax.scripting package for running scripts written in other languages. Java 5 and earlier can use the Apache BSF library.


Ping & DNS - updated with new look and Ping home screen widget
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

Check out the javax.script package.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If you want to call *client*-side JavaScript, however, the answer is no, at least not directly.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Call javascript from Java
 
Similar Threads
JOptionPane No X11 DISPLAY error
reply immediately
How to listen to a button click event within a iframe?
calling java class file from javascript
Calling Javascript function from Java Code