wood burning stoves 2.0*
The moose likes Servlets and the fly likes How a servlet of one Context communicate  with other servlet of different context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How a servlet of one Context communicate  with other servlet of different context" Watch "How a servlet of one Context communicate  with other servlet of different context" New topic
Author

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

Manish manish
Greenhorn

Joined: Apr 30, 2004
Posts: 1
How a servlet of one Context communicate with other servlet of different context
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"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

Joined: Mar 06, 2001
Posts: 13459

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

Joined: Aug 24, 2004
Posts: 250
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


Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How a servlet of one Context communicate with other servlet of different context
 
Similar Threads
about implicit objects
servlet/JSP communication?
Servlet - Servlet Communication
AC and SC
ServletContext question.