Communication between a web app and a simple app
<p>I've got 2 different web applications running.<br/><br/>
'Web application A' has all the business logic layer services.<br/>
I need to invoke methods defined in 'Web application A' from 'Web application B'.<br/>
<br/>
How can I use services(or methods) from 'Web application B' without sending <br/>
a http request ?<br/></p>

<p>So far I've found that you can invoke a java programme as described in this question.<br/>
<a href="http://stackoverflow.com/questions/502494/execute-a-java-program-from-our-java-program">Execute a Java program from our Java program</a>
<br/></p>

<p>I wonder which one is the right way. Call method by sending a http request or call some method directly.<br/> Could you also tell me which one is better, and why ? </p>

<p><b>Edit</b><br/>
Could I use Springframework's remote invoking ? <br/>
<a href="http://static.springsource.org/spring/docs/2.0.x/reference/remoting.html" rel="nofollow">http://static.springsource.org/spring/docs/2.0.x/reference/remoting.html</a><br/>
Which one is more desirable. Spring remoting or EJB ?<br/>
We are using Tomcat.</p>
