Regardless of the business requirement, what you want to achieve is have 2 web applications communicate together.
In your case the web apps are both Java web apps but they could be different languages (C#, Java...) As Pavel points out what you want to achieve is described in Enterprise Integration Patterns and more specifically in Service-Oriented Architectures (SOA).
Right now, to be efficient, you want to consider exposing one web application as a web service. Java gives you two options:
- JAX-WS SOAP-based web services
- JAX-RS REST-based web services
There are great tutorials on either stack you can have a look at. JAX-WS is already part of the Oracle JDK so it doesn't require any additional libraries. Have a look here.