How do I pass objects between two servlets?
I am new to servlet programming. I want to know that ... is it possible to pass objects between two servlets located on different application servers ??? let's say two tomcat servers ...
means what I want to do: [browser] → [application server 1 does some operation on the data] → [server 2 does some operation on the data]
I'm sure this is possible, but can anyone tell me how?
a source to share
Except for server clustering (which you don't want to go into at this point, trust me), the only way to do this is to send a redirect from the first server to another, encoding the data you want to send to the url.
You cannot pass the actual object, since the servlets are on different servers, so data transfer is the best you can manage.
If you enjoy playing with Tomcat clusters, this gives you the ability to store objects in an HTTP session that are replicated across all servers in the cluster. I would definitely categorize this as "advanced use", although not something to get into if you're new to this.
a source to share