The simplest thing to do is pass these values as querystring or post parameters. As Anirvan mentions, you could respond with XML or some other form of structured data.
The cross context sharing of data is possible between different webapps in the same container but the spec doesn't go into a lot of detail about how it should be implemented. So, the implementation will vary from container to container. You might want to go through your container's documentation to see what it offers in this respect.
Another approach is to read and write to a shared database or (if both web applications are on the same machine, file system).
There are a lot of other technologies offered by
Java for interaction between applications. A few are RMI, RPC,
SOAP, and JMS. Google is your best friend when researching these.
Hope this helps.
-Ben