File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Using JAVA with java-script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Using JAVA with java-script" Watch "Using JAVA with java-script" New topic
Author

Using JAVA with java-script

Naeem Arshad
Greenhorn

Joined: May 21, 2009
Posts: 12

i want to initiate some JAVA object(desktop-app) by JAVA-script. Anyone cane help me that how it will be possible?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Java cannot interact with the local filesystem for security reasons. JavaScript can interact with a Java applet.


GenRocket - Experts at Building Test Data
Naeem Arshad
Greenhorn

Joined: May 21, 2009
Posts: 12

Gregg Bolinger! Any other solution to initiate some JAVA object or interacting with some desktop application via java-script(or anything) to the HTML/JSP page?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Naeem Arshad wrote:Gregg Bolinger! Any other solution to initiate some JAVA object or interacting with some desktop application via java-script(or anything) to the HTML/JSP page?


Naeem Ashad! No. Like I said, JavaScript is crippled from being able to communicate with anything outside of the browser for security reasons. I suppose you could write an Applet that was digitally signed and had security rights on the client machine and a desktop app, er, that already sounds way overly complicated. Maybe if you describe what you are trying to do and why we can suggest some alternatives.
Naeem Arshad
Greenhorn

Joined: May 21, 2009
Posts: 12

Gregg Bolinger! The scenario on which i m working is that some desktop application written is JAVA provides some information to the web page and web page responds on the base of that information. this information is like some thing which relates to the local machine on which desktop application is running. I am trying to find a better way of implementation which should be secure and easily implementable on several machines.
I also viewed the Gears and HTML5 'data storage on local machine option' but i think it unsecured and complicated.
Have you any better solution?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Naeem Arshad wrote:Gregg Bolinger! The scenario on which i m working is that some desktop application written is JAVA provides some information to the web page and web page responds on the base of that information. this information is like some thing which relates to the local machine on which desktop application is running. I am trying to find a better way of implementation which should be secure and easily implementable on several machines.
I also viewed the Gears and HTML5 'data storage on local machine option' but i think it unsecured and complicated.
Have you any better solution?


No, I don't. I really don't understand. When you say your desktop application provides information to the web page, how does that happen exactly? Does the desktop application send data to the server via a URL Connection of some sort or what? And what, exactly, are you wanting the web application to do for the desktop?
Naeem Arshad
Greenhorn

Joined: May 21, 2009
Posts: 12

You are right partially. Desktop app passes the information like some URL and i want to implement that when i open my web app, browser should get me to that URL (which is provided by the desktop application) instead of my aeb-app.
I dont know it is a practicle approach. I am requestion for the confirmation of the possibility. If your answer is yes, please give me some idea of implementation.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
As stated, JavaScript has high security which does not allow it to interact and read with files and other programs on the user's computer. You will need to write an applet that can interact with the user's machine.

My question is, you are running a desktop app for security to start, why in the world are you not just writing a desktop application? Web applications are NOT supposed to work this way for security.

Eric
Naeem Arshad
Greenhorn

Joined: May 21, 2009
Posts: 12

Eric! this is my application requirement. Have you any better way to implement this scenario.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Naeem Arshad wrote:Eric! this is my application requirement. Have you any better way to implement this scenario.


Find a new project. lol

Have fun writing an applet.

Eric
Naeem Arshad
Greenhorn

Joined: May 21, 2009
Posts: 12

dear what kind of applet?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Naeem Arshad wrote:dear what kind of applet?


An illogical applet?

Do you know what an applet is?
Naeem Arshad
Greenhorn

Joined: May 21, 2009
Posts: 12

Is there anyone here with enough familiarity with the Gears code-base
to give me an estimate of the effort required to bring Gears up to
date?
 
Consider Paul's rocket mass heater.
 
subject: Using JAVA with java-script