This can be done by establishing URL Connection between the respective
applications using java.net.URLConnection.
Once connection is established requests can be wrote using ObjectOutputStream.
In the second application the request will be received in the doPost and it can
be retrived using ObjectInputStream. (httpServletRequest.getInputStream())
The response can be sent back to the first application using
ObjectOutputStream.