This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Help needed. General question about J2EE architecture.

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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???

Do I need to use RAR adapters?

Any clue very welcome,

Julien.
 
Author
Posts: 531
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you may use RMI, or you can wrap your application services as XML web services to be able to invoke them from the remote web application.

You can create a simple network server nad use the network server but i do not recommand this solution.

Best option, if it does not break your design is web services. IMHO
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic