On the one hand, I have a java class (actually a set of classes) that does a lot of low level input/output operations.
On the other hand I have a web console in jsp/servlets.
I want to be able to invoke a method on the "low-level" java app from the web console bearing in mind that the war will run on one computer on the network and the "low-level" app on another computer on the network.
What is the best way to invoke a public method of the "low-level" app from the web console???
I thought of using web services however I don't know how to connect the low-level app to the app server (I do need an app server in order to have a web service?? Don't I?) Do you see what I mean? Julien.
No, you don't need an app server for WS; a web server with a SOAP engine will suffice (e.g. Tomcat with Axis). If having an extra web server is not possible for some reason, you might take a low-level approach and open a Telnet or SSH session to the target machine, and execute the low-level app in a command-line session. But a WS or RMI approach is certainly to be preferred.
Hello and thanks for the reply, I meant a "container" be it web or ejb (i use the term "app server" a bit freely). Can anyone tell me whether I can connect a servlet to a low-level app that does i/o operations?? Julien.
If by "connect a servlet to the application" you mean how the servlet can run the application and receive results from it, then one way is to use Runtime.exec. It provides the calling application with a Process object, through which input can be piped into the application and its output can be read.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop