This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Call javascript from Java  RSS feed

 
sindhu sheela
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rob Spoor
Sheriff
Posts: 21048
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the javax.script package.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to call *client*-side JavaScript, however, the answer is no, at least not directly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!