This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

A Question in ServletContext

 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one tell me why do we need
Context.getContext()
Regards,
Sangeetha
 
Kevin Jones
Author
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The getContext method takes a string. This is the URI to a different ServletContext running within this container. Once you have this reference you can then call getRequestDispatcher on that context and dispatch requests to servlets running in other web apps. Now,
i) this is probably not a good idea
ii) Containers may prevent this for security reasons
 
danny liu
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that means you wanna access a resource beneath another application.
be careful when you are doing do.
hope that helps.
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!