connect two running servlets to exchange data

Hey everbody,

I’m new to Vaadin and are trying the following task:

on server 1 is a servlet runing that sends data to another servlet (vaadin) running on server 2. Now I need to present the transmitted data via vaadin. The transmission of the data to the vaadin servlet on server 2 already works (I get the data via HttpServletRequest). But I don’t know how to show the data dynamicly. If a user visits the vaadin servlet on server 2 it is a differente session than the session used to transmit the data from server 1 to server 2. So I need something to interecpt the request or sth like that…or I need a way to transmit the data from the vaadin servlet on server 2 to another servlet. So that’s my idea:
a vaadin servlet that gets the data from the running servlet on server 2.
To make it easier to understand what I try:

Server 1|servlet1----------http-------------->server2|servlet2 <--------userservlet <–user

I need the connection between the userservlet and the servlet 2. Both are running when I want to connect

Thanks for your help

I think I found a solution. Not what I was looking for, but still works: I use to store the transmitted data and get them in the second servlet. If somebody knows something to transmit the data between the two running servlets please let me know, it will no work if the servlets are not in the same container

If the listening servlet and the displaying servlet are running in the same war, they share the same class loader. You can therefore use a static class singleton to act as a transmission buffer – the static class is initialized by the classloader on first access. You can also use the BlackBoard add-on to create events in your receiving class that will notify your display class.

This sounds really good, much betten than my solution. Thank you :slight_smile: