3 Replies - 4753 Views - Last Post: 31 March 2010 - 08:35 PM Rate Topic: -----

#1 Mimir   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 15-December 09

Interprocess Communication between Java and JSP

Posted 31 March 2010 - 06:06 PM

Hello all, I'm looking for advice rather than a solution. I have a Java program which communicates with other systems constantly using sockets and updates a database. I have a web-based interface for this system using Java Servlet Pages which access the database to display the appropriate information to the user. However, the JSP application needs to send information back to the Java program running in the background. I have discounted using the database as this is too slow and plan to use sockets to connect to the localhost. Although I'm told using sockets in servlets is a bad idea.

What other ways can I handle interprocess communication between a Java application and a JSP application?

System:

<Other Systems> <-- Sockets --> <Java Application> <-- ??? Sockets ??? --> <JSP Application>

Sorry if this is a stupid question. :dontgetit:

Is This A Good Question/Topic? 0
  • +

Replies To: Interprocess Communication between Java and JSP

#2 kingfeanor   User is offline

  • D.I.C Head

Reputation: 47
  • View blog
  • Posts: 62
  • Joined: 18-April 09

Re: Interprocess Communication between Java and JSP

Posted 31 March 2010 - 07:05 PM

Can you tell us more about the Java Application and the JSPs? The JSPs will have to run in something like tomcat or websphere. Does the java app run in anything? Or is it a system service? A command line app?

One way to deal with a situation like this is to have both sides use web services. If your JSP app consumes functionality from the Java App then have the Java app define a web service interface and the JSP app consume it.

Another thought would be to merge the Java App and the JSP app into a single application. But that would require the Java App to then run in an application container.
Was This Post Helpful? 0
  • +
  • -

#3 Mimir   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 15-December 09

Re: Interprocess Communication between Java and JSP

Posted 31 March 2010 - 07:19 PM

View Postkingfeanor, on 31 March 2010 - 06:05 PM, said:

Can you tell us more about the Java Application and the JSPs? The JSPs will have to run in something like tomcat or websphere. Does the java app run in anything? Or is it a system service? A command line app?

One way to deal with a situation like this is to have both sides use web services. If your JSP app consumes functionality from the Java App then have the Java app define a web service interface and the JSP app consume it.

Another thought would be to merge the Java App and the JSP app into a single application. But that would require the Java App to then run in an application container.


Thankyou for your reply kingfeanor. The Java application comunicates to various embedded systems collecting information and sending requests using sockets, currently it is a command line app, a web based interface was an afterthought. The JSP application runs on tomcat. I'm quite new to this whole JSP thing, how would I go about running the Java app in an application container?
Was This Post Helpful? 0
  • +
  • -

#4 kingfeanor   User is offline

  • D.I.C Head

Reputation: 47
  • View blog
  • Posts: 62
  • Joined: 18-April 09

Re: Interprocess Communication between Java and JSP

Posted 31 March 2010 - 08:35 PM

Not knowing all the particulars, try just moving all the java app into the web app. The code in your java apps main method will have to move into a servlet lifecycle method (you should find info if you google that) so that it is launched when the application starts in tomcat. I would start there.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1