Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transfer Request from on context to other context

 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to transfer a servlet request from one context to other context
If possible can anybody give me the code samples

Regards,
Vasantha
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get a reference to another application's ServletContext like this:

this.getServletContext().getContext(uriPath);

Then, you can save an attribute into that context. Just remember, servlet context attributes are not inherently thread safe!

You could also use the above described method but instead of putting a variable into the servlet context, you put the variable into request context, get a RequestDispatcher from the context you got above, and forward the request to another application.
 
danny liu
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must also enbale "Cross Context" accessibility.

Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic