I have a J2ee application where I basically want two objects created by two separate servlets to exchange directly, and I need these intentions to be stable, i.e. "know" each other during a session.
The sequence is approximately:
- The client sends a request to Servlet # 1, which creates an object A
- The client sends a second request (after the first return) to servlet # 2, which creates object B.
- Object B finds A using JNDI, and both objects interact.
- Now the client continues to send requests to object A, which should again find B.
How can I make sure that these two instances are known by everyone throughout the session? Linking them to JNDI does not completely solve the problem, since object B must communicate with its original servlet (servlet # 2), which is not supported by stable requests.
Any ideas?
Thanks in advance.
Yes, I admit that the description of the problem is a bit vague. But this is not a very simple application. However, I will try to ask him better:
My ultimate goal is to create a “semantic debugger” for my application, which, unlike the java debugger, which simply debugs Java instructions.
Debugging an application is basically a servlet. to which my instrument is connected. The tool maintains a connection to the application through another servlet that controls the debugging process. These two servlets need to constantly and directly communicate with each other.
My current thought is to set up a session with a bean state that will facilitate this message (never did this, still struggling with setting it up).
But I would appreciate any thoughts on how to achieve this better.
source share