0

maybe what I'm asking is difficult to do or even ridiculous, but I'll give it a try anyway.

I have a typical PHP website, with a products list. And I have a Java application which manages the products (CRUD). In that application I have a JDialog that pops up when I select to edit a product.

My question is: ¿Is there a way, no matter how difficult to implement, in which I click an "Edit product" button on the webpage and the java application JDialog pops up to edit that product?

Thank you.

Kunstmann
  • 109
  • 1
  • 10
  • the best way i think is a browser extension – Madhawa Priyashantha Jun 16 '15 at 13:59
  • The short answer is no. The long answer is if you can modify the Java application, allow it to support XML-RPC calls (or some way so that your PHP application can communicate with your Java application) – Chris Forrence Jun 16 '15 at 14:00
  • @ChrisForrence Yes, you can. Make it an applet, then you can call what you need Java side from JavaScript. https://docs.oracle.com/javase/tutorial/deployment/applet/invokingAppletMethodsFromJavaScript.html – user489041 Jun 16 '15 at 14:12
  • 1
    Correct, but the problem with Applets is that it's deprecated technology ... latest chrome doesn't support it anymore for instance. – Karsten Daemen Jun 16 '15 at 14:17
  • 1
    If the java application is simply a CRUD application I see no reason why you wouldn't be able to do it just a PHP-only backend. – Kuurde Jun 16 '15 at 17:06

1 Answers1

1

I'm no expert on the matter but take a look at custom protocol handlers.

Define a custom protocol myapp:\\ that you can use on your web page in hrefs like:

<a href="myapp:\\open-product1">Open Product 1</a>

Then on OS level you need to specify how this protocol should be handled. (In your case that will be to run your Java program with the correct arguments to open product1). The installation of your Java program should make the necessary changes to the OS in order to correctly handle this custom protocol.

Take a look at this site for more information.

  • I think that's what I need, unfortunatelly I can't make it work, and every guide I've read talks about web based protocols and not protocols to open desktop applications – Kunstmann Jun 16 '15 at 17:12