File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How a servlet of one Context communicate with other servlet of different context

 
Manish manish
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How a servlet of one Context communicate with other servlet of different context
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Manish manish",
Welcome to the JavaRanch!
We're a friendly bunch and light on rules, but one we take quite seriously is the display name rule. You can read it here.

Basically we require your display name to be two words: your first name, a space, then your last name. Obviously fictitious names are not allowed.

Please edit your profile and choose a display name which complies with our rules. Unfortunately accounts with invalid display names get deleted, often without warning.

thanks,
Dave
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you describe what you mean by 'communicate'? There are a number of 'central' places which could be used to convey information between servlet contexts.

The easiest is a common database, but you could also use EJBs or another standard distributed layer, HTTP calls, common static code or the request dispatcher. It all depends on what you're looking for.

Dave
 
sawan parihar
Ranch Hand
Posts: 250
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi manish,
What you mean by 'communicate'. If you have to forward a request from one servlet to another in a different context you need to first get the other context. You can do something like this

thisContext.getContext("path");

Then you can use the returned context to forward you requestd,

Hope that helps... If not please be more specific about what you want to know.

cheers
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic