Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Inter Servlet Communication  RSS feed

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IS this same as forward and including a page.
 
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It can be much more than that. I guess we can broadly classify the interservlet comm. into two categories. First, between servlets running under the same web context and secondly running under different web contexts as in a truly distributed environment.
Typically when we say servlets communicating with each other, it may imply the exchange of information via objects. Objects can be stored at different scopes like application, session and request using keys to retrieve them across servlets.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do servlets in distributed env communicate or share objects.
Why is the need for servlets in different web context to communicate.
If we do a J2ee project won't all the components be in one server.
Somehow can anyone explain it more clearly.?
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't get to work with servlets contacting each other from different web contexts, but i'm pretty sure such a thing exists. If you ask me under what scenario, the people who work full fledged on these things should come up with the situations. I'm also waiting to hear from someone on this.
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't get to work with servlets contacting each other from different web contexts, but i'm pretty sure such a thing exists. If you ask me under what scenario, the people who work full fledged on these things should come up with the situations. I'm also waiting to hear from someone on this.
Trust me, it exists. I work for a large corporation and we have our site spread across many servers.
how do servlets in distributed env communicate or share objects.
There are lots of ways, but the two most important ways are using databases and EJBs. You can use serialized objects and a URLConnection to communicate between servlets or just RMI.
Why is the need for servlets in different web context to communicate.
If we do a J2ee project won't all the components be in one server.

Load balancing, failsafe issues (you don't want the whole site going down if just one server crashes), keeping logical sections of the site separated, mitigating risk when deploying new development, etc.

If we do a J2ee project won't all the components be in one server.

That's fine for a small site but isn't practical for a large enterprise operation. It does complicate matters though, because you could cross JVMs several times with a single request. That can make debugging tuff, but interesting. Also note that for a full J2EE project, you would have EJBs somewhere which lend themselves well to a distributed environment. That fact that they can easily be accessed remotely is one of their main selling points, along with built-in transaction management and container managed persistence.
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Michael Morris:

Why is the need for servlets in different web context to communicate.
If we do a J2ee project won't all the components be in one server.

Load balancing, failsafe issues (you don't want the whole site going down if just one server crashes), keeping logical sections of the site separated, mitigating risk when deploying new development, etc.
[b]


Michael,
Can you please direct me to any resources on the web that talk about replicating sessions in the event of server crash, etc., so that the user would never feel any change, despite for some latency? I would appreciate your inputs.
Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!