Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830
this week in the
Programmer Certification
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Liutauras Vilda
Jeanne Boyarsky
paul wheaton
Sheriffs:
Ron McLeod
Devaka Cooray
Henry Wong
Saloon Keepers:
Tim Holloway
Stephan van Hulst
Carey Brown
Tim Moores
Mikalai Zaikin
Bartenders:
Frits Walraven
Forum:
Java in General
Calling .js file from Java
Shailendra Suryawanshi
Greenhorn
Posts: 9
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Is there any way we could call Javascript function in a .js file from
Java
?
Shailendra Suryawanshi<br /> <br />[SCJP 6]
Bear Bibeault
Sheriff
Posts: 67752
173
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Are you asking about Java running on the server (as part of a
servlet
or
JSP
), or as an
applet
on the client.
if the former, no. Please read
this article
to understand why.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Shailendra Suryawanshi
Greenhorn
Posts: 9
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
My expectation is to call a javascript function in a .js file from a normal Java class file.
I don't want to call it from jsp/servlet or applet.
Shailendra Suryawanshi<br /> <br />[SCJP 6]
Bear Bibeault
Sheriff
Posts: 67752
173
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Without a servlet, JSP or applet, how do you expect to run this Java class as part of the web application?
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Shailendra Suryawanshi
Greenhorn
Posts: 9
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
It's not a web application.
I've a BPM studio which has the ability to call Java classes.
Now I wish to invoke javascript from this Java class, which now I guess is not possible.
Please comment.
Shailendra Suryawanshi<br /> <br />[SCJP 6]
Ulf Dittmer
Rancher
Posts: 43081
77
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The Rhino library lets you run JavaScript scripts from within regular Java classes. There was an
article about that
in the JavaRanch Journal last year.
Bear Bibeault
Sheriff
Posts: 67752
173
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Ah,
you should
have mentioned that. Most questions here are related to web apps. I've moved this to a general Java forum.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Let me tell you a story about a man named Jed. He made this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
interpret java code <% ..%> in .js file
Java embedded in .JS file not working
embedding Java inside html/,js file not working
configure tomcat to accept embedded java in .JS file
Calling .js from another .js
More...